I am calling a simple JOIN SQL on a mySQL database. The exact query called from the PHP script is:
SELECT *
FROM weighteventtest
LEFT JOIN commenttest ON weighteventtest.eventid=commenttest.eventid
ORDER BY weighteventtest.eventid DESC
When I run the sql query directly in phpMyAdmin, I get a normal result set with all values. But when the script is called through PHP, the 'eventid' field is empty or null for nearly all rows. When I echo the values of each row, all fields have a value except the primary key 'eventid', which is empty, EXCEPT FOR the rows where there is a match on the joined table.
Any ideas? thanks! Will.