SkaFreaks
09-03-2004, 12:30 PM
Hey
ok, I'm not sure if you can do this or how to, so I'll just explain what I want to do .
I have 2 tables in a database (contests, contestswin) Contests contains (conid, conname, condescription) Contestswin contains (winid, conid, conwinner)
Some of the contests have multiple winners, so I want it to list the contest name then all the winners for that contest and then show the next contest and continue on.
this is what I tried but it didn't work, it may help explain more of what I want.
$db2 = mysql_connect("localhost", "name", "pass");
mysql_select_db("skafreak_nuke1",$db2);
$result = mysql_query("SELECT * FROM contests, contestswin WHERE contests.conid=contestswin.conid ORDER BY condeadline",$db2);
while ($myrow = mysql_fetch_array($result)) {
printf("%s<br>\n", $myrow["conname"]);
while ($myrow = mysql_fetch_array($result)) {
printf("<li>%s\n", $myrow["conwinner"]);
} }
Thanks for any help!
ok, I'm not sure if you can do this or how to, so I'll just explain what I want to do .
I have 2 tables in a database (contests, contestswin) Contests contains (conid, conname, condescription) Contestswin contains (winid, conid, conwinner)
Some of the contests have multiple winners, so I want it to list the contest name then all the winners for that contest and then show the next contest and continue on.
this is what I tried but it didn't work, it may help explain more of what I want.
$db2 = mysql_connect("localhost", "name", "pass");
mysql_select_db("skafreak_nuke1",$db2);
$result = mysql_query("SELECT * FROM contests, contestswin WHERE contests.conid=contestswin.conid ORDER BY condeadline",$db2);
while ($myrow = mysql_fetch_array($result)) {
printf("%s<br>\n", $myrow["conname"]);
while ($myrow = mysql_fetch_array($result)) {
printf("<li>%s\n", $myrow["conwinner"]);
} }
Thanks for any help!