
Originally Posted by
twick100
...
ORDER BY fname;";
...
If the query you posted has been copy & pasted from your code as above then the error is probably that you have the semi-colon included at the end of it (between fname and the closing double quote of the string). You do not need to include the semi colon in the query string when calling a query in the bean. You only need that when you are running a SQL query in the terminal window.
The query string in your code should look like this:
PHP Code:
$query =
"SELECT f.name fname, f.state, f.city, f.id fid, cl.alt_asd_ida, cl.alt_asdd_idb, c.ave_amount, c.asd, c.name, cc.first_name, cc.last_name, cc.id cid, cc.phone_work
FROM alt_facilities f
INNER JOIN alt_facchem_c cl ON (f.id = cl.alt_facit_ida)
INNER JOIN alt_chemicals c ON (cl.alt_fasad_idb = c.id)
LEFT OUTER JOIN alt_f2334_c con ON (f.id = con.alt_56_ida)
LEFT OUTER JOIN contacts cc ON (con.alt_asdds_idb = cc.id)
WHERE c.name = 'lead'
AND f.state IN ('AL','FL')
ORDER BY fname";
Regards,
JH.
Bookmarks