I have a fully working query, however, I don’t know how to read the results in PHP.
SELECT * FROM [...]
LEFT JOIN media ON m_media_id=r_release_media_id
[...]
LEFT JOIN media AS episode_media ON episode_media.m_media_id=ms_media_id
Here’s the thing: I’m calling the “media” table twice, as you can see. It reads out great as a SQL query, but I get media.m_media_id and episode_media.m_media_id – how do I get those in PHP?
I’m calling the query like this, however the $record-> part doesn’t work as the dot messes it up. How do I do this correctly?
$result = mysql_query($sql);
while ($record = mysql_fetch_object($result)) {
$1 = $record->media.m_media_id
$2 = $record->episode_media.m_media_id
}
I’ve searched to find the answer but I can only find the MySQL queries, not the PHP part. Thanks.
You should use aliases.
I suggest querying like this:
Then you should be able to call them as: