Quick probably easy question - Doing multiple query's
Posted: Thu Sep 28, 2006 5:43 pm
First query is
That will take term=_____ from the address bar and find all values in mini_profile that match.
Then I need to get the global_id associated with the matching row
Next I need to query the table called loginphp and match up that $row['global_id'] with the matching global_id in that table, then echo the fields Fname and Lname.
so far I have:
How do I modify that to echo Fname Lname from the loginphp where the global_id matches the initial query of mini_info and grabs the global_id that matches the search term (either Male or Female)?
And it needs to loop through all matching rows, not just one of them, that is key
Thanks in advance
Code: Select all
$result = mysql_query("SELECT * FROM mini_info WHERE sex='$_GET[term]'") or die(mysql_error());
$row = mysql_fetch_array( $result );Then I need to get the global_id associated with the matching row
Code: Select all
$row['global_id'];so far I have:
Code: Select all
<?php
$section = $_GET['section'];
if($section == "sex")
{
$result = mysql_query("SELECT * FROM mini_info WHERE sex='$_GET[term]'") or die(mysql_error());
?>
<tr>
<td valign="top">
<?php
$row_count = mysql_num_rows( $result );
$i == 0;
while($i < $row_count)
{
$row = mysql_fetch_array( $result );
//SOME CODE NEEDS TO GO HERE!
$i++;
} ?>
</td>
</tr>
</table>
<?php
}
?>And it needs to loop through all matching rows, not just one of them, that is key
Thanks in advance