unemployment Posted March 15, 2011 Share Posted March 15, 2011 The timestampdiff() fails. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(MINUTE, `transactions`.`buy_date`, `transactions`.`end_date`) AS `time_left` ' at line 4 $sql = "SELECT `transactions`.`buy_date`, `transactions`.`end_date` TIMESTAMPDIFF(MINUTE, `transactions`.`buy_date`, `transactions`.`end_date`) AS `time_left` FROM `transactions` WHERE `transactions`.`uid` = '${user_info["uid"]}'"; Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted March 16, 2011 Share Posted March 16, 2011 you need a comma after: `transactions`.`end_date` Quote Link to comment Share on other sites More sharing options...
unemployment Posted March 16, 2011 Author Share Posted March 16, 2011 Good catch, but it still doesn't work. I have...It still fails on the TIMEDIFF line. $sql = "SELECT `transactions`.`buy_date`, `transactions`.`end_date`, TIMEDIFF(`transactions`.`buy_date`, `transactions`.`end_date`) AS `time_left` FROM `transactions` WHERE `transactions`.`uid` = '${user_info["uid"]}'"; Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted March 16, 2011 Share Posted March 16, 2011 What is the data type of the two fields you're trying to compare? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.