Jump to content

TIMESTAMPDIFF()


unemployment

Recommended Posts

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"]}'";

Link to comment
https://forums.phpfreaks.com/topic/230758-timestampdiff/
Share on other sites

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"]}'";

Link to comment
https://forums.phpfreaks.com/topic/230758-timestampdiff/#findComment-1188112
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.