PDA

View Full Version : Is my code correct?


RyanB88
04-25-2006, 12:47 AM
I got this php code for a mysql query it should insert the date, time, and ip of the computer accessing the php script and should let the mysql server set the ID.

$querytwo = "INSERT INTO `logs_failedreg` ( `ID` , `Date` , `Time` , `IP` )VALUES ('', date(Y-m-d), date(G:i:s), '{$_SERVER['REMOTE_ADDR']}')";

the date format should be yyyy-mm-dd
the time format should be 00:00:00 (24 hour, no AM/PM)

I have no way of testing this until the rest of my script it complete but i'd like to know this will work before I move on, thanks in advance..

guelphdad
04-25-2006, 01:04 AM
why can't you create a test script and test it with a test table to see if it works?

ablaye
04-25-2006, 02:38 AM
Make sure you leave a space between the ')' and the VALUES.