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...

Recommended Answers

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

Jump to Post

All 2 Replies

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.