Jump to content

[SOLVED] Query question


Aureole

Recommended Posts

I have these two queries, I'm pretty sure it'd be possible to do this with only one query but I can't really think how. Any ideas?

 

<?php
$queryA = "SELECT `forum_name`, `forum_id`, `forum_parent_id`
        FROM `forums`
	INNER JOIN `topics`
	ON `topics` . `topic_parent_id` = `forums` . `forum_id`
	WHERE `topic_id` = '{$_GET['id']}'";
$resultA = mysql_query( $queryA );
$assocA = mysql_fetch_assoc( $resultA );

$queryB = "SELECT `cat_name`, `cat_id`
               FROM `categories`
               WHERE `cat_id` = '{$assocA['forum_parent_id']}'";
$resultB = mysql_query( $queryB );
$assocB = mysql_fetch_assoc( $resultB );
?>

Link to comment
https://forums.phpfreaks.com/topic/87861-solved-query-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.