954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Sytax Error

mysql_query("UPDATE hostip SET time = '".date("d/m/y h:m:s")."' WHERE ipaddress = '".$ip."'");


Whats the problem in this query.... Its giving me syntax error...

Majestics
Practically a Master Poster
622 posts since Jul 2007
Reputation Points: 199
Solved Threads: 50
 

Date format is incorrect, use Y-m-d format or the mysql NOW() function.

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

I already used that format in insert query and it worked fine... but in update query it is giving me error. thank you for a nice suggestion to use NOW() function.

Majestics
Practically a Master Poster
622 posts since Jul 2007
Reputation Points: 199
Solved Threads: 50
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: