General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 23rd, 2003, 12:17 AM
CHornJr's Avatar
CHornJr CHornJr is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: New York City
Posts: 236 CHornJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 50 m 36 sec
Reputation Power: 17
Send a message via AIM to CHornJr Send a message via MSN to CHornJr Send a message via Yahoo to CHornJr
Question 2 more Stupid Question: Trying to insert into the second table

I am trying to get my log-in script to create a log of who logs in and when. Unfortunetly it keeps giving me an error.

Quote:
Parse error: parse error, unexpected T_STRING in /home/virtual/site4/fst/var/www/html/test/login.php on line 31


I do not see what is wrong though. Below is the code and line 31 is the query


PHP Code:
while($row=myql_fetch_array($result))
               {
                
$fn=$row['firstname'];
                
$ln=$row['lastname'];
                
$name$fn.' '.$ln;
                
$un=$row['username'];
                
$lev=$row['level'];
                
mysql_query("INSERT INTO loginlog (name, username, level, timein) VALUES ('$name','$un','$lev')")or die('Could not update the log information 'mysql_error()'); 


Also, I have two timestamp columns. One for when they log in and one which is gonna be for when they log out. I know with a timpstanmp you normally use the "NOW()" function, but i do not know how to use it with php.
__________________
CHornJr
"One day I'll know what I am doing"
My Blog
Suanhacky Lodge #49
Rebel Squadrons

Reply With Quote
  #2  
Old February 23rd, 2003, 11:28 AM
Sork Sork is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 8 Sork User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This ...
PHP Code:
or die('Could not update the log information 'mysql_error()'); 

will be ...
PHP Code:
or die('Could not update the log information '.mysql_error()); 

Notice that one field is missing
PHP Code:
(nameusernameleveltimeinVALUES ('$name','$un','$lev','$TIMEIN_MISSING')") 

For timstamp use the time() function see php manual for more information.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > 2 more Stupid Question: Trying to insert into the second table


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap