hi,
I was just wondering if anyone had a suggestion I am trying to display the results of a join on webpage. The selection renders a result when typed directly into the command line but only seems to return an invalid mysql result resource when run through the code.
the selection is as follows
SELECT b.request_id, CONCAT(a.lname, " ", a.fname) as name, b.received
FROM new_contacts as a, new_requests as b
WHERE a.new_contact_id = b.new_contact_id
ORDER BY b.received, name ASC;
...I've echoed out the $sql variable and it is exacly as printed above, and I've checked with an "if" statement...
if(mysql_query($sql)){
echo('it works');
}elseif(!mysql_query($sql)){
echo(mysql_error());
}
...and gotten nothing whatsoever printed to the screen.
- I know it works from using the command line
- I know its running as printed from echoing onto the screen
- I cant seem to generate the mysql_error() msg but get the invalid result resource msg..
...Does anyone have answer or a suggestion (short of handling the data management with more application code VS. an SQL Join)
THANKS!