SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 28 of 28
  1. #26
    psycho
    Join Date
    May 2000
    Location
    London
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am just using simple html to render the table with no php whatsover.

    Thanks
    James

  2. #27
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It really looks like you are gonna have to restructure stuff a bit, since you will have an uncertain number of matches at any given time, YOu will have to know which match each record belongs to or you will have to loop through the array that I showed you earlier to see if there is a match inthe array for round 1 and if there is then you would print the names of the competitors and if not then you would put coming soon.. But you would still need to keep track of which usernames have been displayed so that you wouldn't repeat any. Let me look it over some more and maybe I can figure out a solution for you.

    One more thing in your example you have 4 matches then two then one then the final and then the same thing coming from the other side to determine the two in the final so that makes 8 in the 1st round 4 in the second two in the third and one final correct? Can you make another field in the table called match number that corresponds to the match number of the round for instance if that field was called order and it had a 1 in it and the round had a 3 in it this would be the 1 match in round three. If you can do that I think I have your solution and I will post in a bit.
    <Edited by freddydoesphp on 12-11-2000 at 06:51 PM>
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #28
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    James I think it should work, there was really no easy way to do that one.
    <?
    $result = mysql_query("somequery");
    while ($row = mysql_fetch_array($result)) {
    $newarray[] = array("id" => $row["ID"], "name1" => $row["name1"],
    "name2" => $row["name2"], "round" => $row["round"], "order" => $row["order"]);
    }
    ?>

    <html>
    <head>
    <title>Untitled</title>
    </head>

    <body>
    <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#333333">
    <tr align="center" valign="middle">
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 1) && ($newarray[$key]["order"] == 1)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>

    </font></td>
    <td bgcolor="#000000">&nbsp;</td>
    <td bgcolor="#000000" rowspan="3" colspan="5">&nbsp;</td>
    <td bgcolor="#000000">&nbsp;</td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 1) && ($newarray[$key]["order"] == 5)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    </tr>
    <tr align="center" valign="middle">
    <td bgcolor="#000000">&nbsp;</td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 2) && ($newarray[$key]["order"] == 1)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 2) && ($newarray[$key]["order"] == 3)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    <td bgcolor="#000000">&nbsp;</td>
    </tr>
    <tr align="center" valign="middle">
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 1) && ($newarray[$key]["order"] == 2)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    <td bgcolor="#000000" rowspan="3">&nbsp;</td>
    <td bgcolor="#000000" rowspan="3">&nbsp;</td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 1) && ($newarray[$key]["order"] == 6)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    </tr>
    <tr align="center" valign="middle">
    <td bgcolor="#000000">&nbsp;</td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 3) && ($newarray[$key]["order"] == 1)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    <td bgcolor="#000000">&nbsp;</td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 4) && ($newarray[$key]["order"] == 1)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    <td bgcolor="#000000">&nbsp;</td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 3) && ($newarray[$key]["order"] == 2)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    <td bgcolor="#000000">&nbsp;</td>
    </tr>
    <tr align="center" valign="middle">
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 1) && ($newarray[$key]["order"] == 3)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    <td bgcolor="#000000" rowspan="3" colspan="5">&nbsp;</td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 1) && ($newarray[$key]["order"] == 7)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    </tr>
    <tr align="center" valign="middle">
    <td bgcolor="#000000">&nbsp;</td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 2) && ($newarray[$key]["order"] == 2)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 2) && ($newarray[$key]["order"] == 4)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    <td bgcolor="#000000">&nbsp;</td>
    </tr>
    <tr align="center" valign="middle">
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 1) && ($newarray[$key]["order"] == 4)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    <td bgcolor="#000000">&nbsp;</td>
    <td bgcolor="#000000">&nbsp;</td>
    <td bgcolor="#000000"><font face="verdana" size="1" color="#C0C0C0">
    <?
    while(list($key,$val) = each($newarray)) {
    if(($newarray[$key]["round"] == 1) && ($newarray[$key]["order"] == 8)) {
    print $newarray[$key]["name1"]." vs ".$newarray[$key]["name2"];
    }
    else {
    print "Coming Soon...";
    }
    }
    reset($newarray);
    ?>
    </font></td>
    </tr>
    </table>


    </body>
    </html>
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •