Hi ,
I'm trying to use a basic syntax in one of my pages which uses MySQL data .
Logic is simple as you can see , I want to see the reports of staff whom works for department 1 .
Both staff and reports table have the field staff_id , so we do not have any type or table config errors BUT MySQL returns this error ;
I checked the MySQL Documentation and saw that it supports WHERE ... IN clause , also they used a very simple and similiar code as an example on their pages .
What can be the problem ? Is there any chances that our (JodoHost's) MySQL servers do not support this kind of basic syntax .
BTW I'm using Jodo MySQL 5 for my database , the one with ip 64.1XX.XXX.X50
Any help or idea will be great .
Thanks
I'm trying to use a basic syntax in one of my pages which uses MySQL data .
Code:
SELECT * FROM reports WHERE staff_id IN ( SELECT staff_id FROM staff WHERE department_id = 1 )
Logic is simple as you can see , I want to see the reports of staff whom works for department 1 .
Both staff and reports table have the field staff_id , so we do not have any type or table config errors BUT MySQL returns this error ;
Code:
#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 'SELECT staff_id FROM staff WHERE department_id = 1 )
LIMIT 0, 30' at
I checked the MySQL Documentation and saw that it supports WHERE ... IN clause , also they used a very simple and similiar code as an example on their pages .
What can be the problem ? Is there any chances that our (JodoHost's) MySQL servers do not support this kind of basic syntax .
BTW I'm using Jodo MySQL 5 for my database , the one with ip 64.1XX.XXX.X50
Any help or idea will be great .
Thanks