
February 22nd, 2003, 11:17 PM
|
 |
Contributing User
|
|
Join Date: Nov 2002
Location: New York City
Posts: 233
Time spent in forums: 1 Day 50 m 19 sec
Reputation Power: 6
|
|
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.
|