I have been trying to debug this for quite a while now with no success.
It seems that my mySQL query breaks as soon as I add a where clause to the below query.
Note this returns no results when it should:
SELECT * FROM `workorders` WHERE (`status`='Open') AND
`job_site_name` LIKE '%".$searchword."%' ORDER BY `date_promised` ASC LIMIT 20
This is the same query without the where clause and it returns results as expected, but I need the where status=Open
as part of the query...
SELECT * FROM `workorders` WHERE
`job_site_name` LIKE '%".$searchword."%' ORDER BY `date_promised` ASC LIMIT 20
Furthermore, this works (and shows that the status column exists and works in other cases):
SELECT * FROM `workorders` WHERE (`status`='Open') AND `invoice_number` LIKE
'%".$searchword."%' ORDER BY `date_promised` ASC LIMIT 20
I appreciate any assistance in identifying the cause of this problem.
Many thanks in advance!