Jump to content

PHP/MySQL LEFT JOIN question


SocomNegotiator

Recommended Posts

Ok here is my normal query:

 

$result = mysql_query("SELECT * FROM " . $config['ladder_prefix'] . "tournaments ORDER BY id DESC LIMIT 5");
$row = mysql_fetch_array($result);

 

Now this query works fine it is in a for statement...however I need to throw in there 2 left joins. Well two left joins is what I think I need maybe someone might have another opinion. What I need is to take the $row['arena_id'] (which was produced from the above query), and say that the field "id" of table "arenas" is equal to that. Then I need to left join $arena['url'] (which is the result of the first left join) to the field "url" in the "categories" table.

 

How would I do this...and is this a good way to do this? Or is there a better more efficient way?

Link to comment
https://forums.phpfreaks.com/topic/123677-phpmysql-left-join-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.