FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

logging problems

 


riyadh
i wrote a download system in php so that my downoad links look like
Quote:
http://www.mysite.frih.net/download.php?file=100
i also wrote further code so that the user's ip address, the date of the download, and the file downloaded are recorded in a database which i can view from a php page i made to pull this data from the database. problem is, the code i use to log all this doesn't work. the code is below. someone plz help.

Code:
$datetime = date('d M Y h:i:s a');
   $ip = $_SERVER['REMOTE_ADDR'];
   $querystat = "INSERT INTO stats (id, ip, date/time) VALUES('$file','$ip','$datetime')";
   $resultstat = mysql_query($querystat);
   if (!$result){
      echo("Database Error");   
DanielXP
Im not sure but i don't think u can have / in between date and time
Rhysige
Perhaps try making it
Code:

INSERT INTO stats (`id`, `ip`, `date/time`)

Might work...
riyadh
thnx DanielXP for your support. seems the '/' between date and time was causing all the problems.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.