We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,166 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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

2
Contributors
2
Replies
1 Hour
Discussion Span
1 Year Ago
Last Updated
3
Views
Question
Answered
Majestics
Practically a Master Poster
696 posts since Jul 2007
Reputation Points: 209
Solved Threads: 66
Skill Endorsements: 5

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

pritaeas
Posting Prodigy
Moderator
9,293 posts since Jul 2006
Reputation Points: 1,178
Solved Threads: 1,462
Skill Endorsements: 86

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
696 posts since Jul 2007
Reputation Points: 209
Solved Threads: 66
Skill Endorsements: 5
Question Answered as of 1 Year Ago by pritaeas

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0649 seconds using 2.78MB