proctk Posted February 21, 2008 Share Posted February 21, 2008 SQL Error: SELECT buddylink.buddy_id, buddylink.owner_id, privacy.email_birthday, privacy.user_id, buddylink.mailyear, FROM buddylink LEFT JOIN privacy ON buddylink.owner_id = privacy.user_id WHERE buddylink.status = '2' AND buddylink.mailyear != YEAR(CURDATE()) AND privacy.email_birthday = '0' 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 'FROM buddylink LEFT JOIN privacy ON buddylink.owner_id = privacy.user_id WHERE b' at line 1 Link to comment https://forums.phpfreaks.com/topic/92217-mysql-error-help/ Share on other sites More sharing options...
proctk Posted February 21, 2008 Author Share Posted February 21, 2008 any idea where the error is Link to comment https://forums.phpfreaks.com/topic/92217-mysql-error-help/#findComment-472405 Share on other sites More sharing options...
bpops Posted February 21, 2008 Share Posted February 21, 2008 'buddylink.mailyear,' do you need that comma there? Link to comment https://forums.phpfreaks.com/topic/92217-mysql-error-help/#findComment-472417 Share on other sites More sharing options...
proctk Posted February 21, 2008 Author Share Posted February 21, 2008 thanks I was going blind looking Link to comment https://forums.phpfreaks.com/topic/92217-mysql-error-help/#findComment-472422 Share on other sites More sharing options...
proctk Posted February 21, 2008 Author Share Posted February 21, 2008 Hi I have been staring at this one for a while to. Any ideas whats wrong SQL Error: SELECT * (DAYOFYEAR(CURDATE()+INTERVAL 15 day) - DAYOFYEAR(DOB)) AS diff FROM users HAVING diff BETWEEN 1 AND 15 AND user_id = '63' 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 '(DAYOFYEAR(CURDATE()+INTERVAL 15 day) - DAYOFYEAR(DOB)) AS diff FROM users HAVIN' at line 1 Link to comment https://forums.phpfreaks.com/topic/92217-mysql-error-help/#findComment-472426 Share on other sites More sharing options...
revraz Posted February 21, 2008 Share Posted February 21, 2008 This is wrong SELECT * (DAYOFYEAR(CURDATE()+INTERVAL 15 day) - DAYOFYEAR(DOB)) What are you trying to select? Link to comment https://forums.phpfreaks.com/topic/92217-mysql-error-help/#findComment-472439 Share on other sites More sharing options...
proctk Posted February 21, 2008 Author Share Posted February 21, 2008 Get all entries from the table who has a birthday within 15 days. Link to comment https://forums.phpfreaks.com/topic/92217-mysql-error-help/#findComment-472447 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.