2 separate $results from mySQL query in 1 file

I am making a php page, which will have content that changes based on the selected menu item.

so far, i have the menu itself loading correctly:

while ($i < $num) {

echo “<a href=‘redir.php?menuname=$menuname’>$menuname</a>” ?></p></b></td>


the file called redir.php does not yet exist. I was thinking it would be a separate php file which determines the content that should be echoed into THIS php doc.


I could have the hyperlink in the menu simply return the selection to this same index file.
and have the content pulled from the relevant row in the table.

As in:

mysql_connect($dbhost, $dbuser, $dbpasswd);
@mysql_select_db($dbname) or die( “Unable to select database”);
$query=“SELECT * FROM Gallery WHERE menuname=’$selection’”;


while ($i < $num) {

This second method seems to be a lot simpler, but also more complicated.
My question is this: how can i have these 2 separate $results in the same file?
How can i have 2 different queries to the mySQL db without causing total insanity?

thanks for whatever help you can give!