FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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.
Related topics
Facing Many Problems
New forum area (computer problems)
Problems With Index Page
FTP problems --> Use Filezilla and/or active mode
activation
problems
Directadmin Server 2 Problems
Javascript problems in Firefox 2? [box.net]
Logoff Problems
security certificate login problems
session_destroy problems
Header problems
Problems Logging into Squirrel Mail
Having Problems Logging In
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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