Squintz
12-18-2002, 09:03 PM
I have a table which stores user information...
User:
User_ID
Name
and i have a table the stores Contest Results
Contest_Results:
User_ID
Contest_ID
Votes
i have done this query
SELECT * FROM Contest_Results WHERE Contest_ID = $Contest_ID ORDER BY $Votes Asc
Now i want to list all the users Names Who have entered the contest which i just queryed... How do i do this?
Just for kicks i will add the code i have
<?
$sql = "SELECT * FROM Contest_Results WHERE Contest_ID = $Contest_ID ORDER BY $Votes Asc";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_object($result)){
echo"<tr>"
echo"<td width="100%" height="29">";
echo"<table border="1" width="100%">";
echo"<tr>";
echo"<td width="80%" bgcolor="#1003BD">Author's Name</td>";
echo"<td width="20%" bgcolor="#1003BD">Votes</td>";
echo"</tr>";
echo"</table>";
echo"</td>";
echo"</tr>";
<tr>
}
?>
User:
User_ID
Name
and i have a table the stores Contest Results
Contest_Results:
User_ID
Contest_ID
Votes
i have done this query
SELECT * FROM Contest_Results WHERE Contest_ID = $Contest_ID ORDER BY $Votes Asc
Now i want to list all the users Names Who have entered the contest which i just queryed... How do i do this?
Just for kicks i will add the code i have
<?
$sql = "SELECT * FROM Contest_Results WHERE Contest_ID = $Contest_ID ORDER BY $Votes Asc";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_object($result)){
echo"<tr>"
echo"<td width="100%" height="29">";
echo"<table border="1" width="100%">";
echo"<tr>";
echo"<td width="80%" bgcolor="#1003BD">Author's Name</td>";
echo"<td width="20%" bgcolor="#1003BD">Votes</td>";
echo"</tr>";
echo"</table>";
echo"</td>";
echo"</tr>";
<tr>
}
?>