1,105,334 Community Members

Sytax Error

Member Avatar
Majestics
Practically a Master Poster
694 posts since Jul 2007
Reputation Points: 84 [?]
Q&As Helped to Solve: 66 [?]
Skill Endorsements: 6 [?]
 
0
 
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...

Member Avatar
pritaeas
mod_pritaeas
11,313 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 155 [?]
Moderator
Featured
Sponsor
 
1
 

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

Member Avatar
Majestics
Practically a Master Poster
694 posts since Jul 2007
Reputation Points: 84 [?]
Q&As Helped to Solve: 66 [?]
Skill Endorsements: 6 [?]
 
0
 

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.

Question Answered as of 2 Years Ago by pritaeas
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: