Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003

    Unanswered: Border around my records....

    right i have been playing with this allday, but am starting to pull my hair out...

    here is what i have so far!

    you will notice that the Donald duck photo at the bottom is in a border and thats what i want for all the records, still dont's get why the records are shown as before also, and Doanld is shown twice?

    latest snippet of code is as follows

    <title>RTFC Players 2006/07</title>
    mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); 
    $query="SELECT * FROM players"; 
    echo "<b><h1><center>Season 2006/07 Squad</center></h1></b><br><br>"; 
    while ($i < $num) { 
    if(trim($Photo)!="") $Photo="<img src=\"$Photo\" border=\"0\" alt=\"Select this for a more detailed image\">";
    else $Photo="<img src=\"\" border=\"0\" alt=\"Select this for a more detailed image\">";
    echo "<b>$Forename$Surname</b><br>Date Of Birth: $DOB<br>Nickname: $Nickname<br>Photo: $Photo<br>Reg No: $RegNo
    <br>Comments: $Comments<br>Position: $Position<br>Games Played: $GamesPlayed<br>Goals Scored: $GoalsScored <br> <br><hr><br>"; 
    echo "<table style=\"border:1px solid #999999;\" cellspacing=\"3\" cellpadding=\"5\" width=\"70%\" align=\"center\" border=\"0\">";
            echo "<tr>";
            echo "<td><b>Name:</b></td>";
            echo "<td>$Forename$Surname</td>";
            echo "</tr><tr>";
            echo "<td><b>Date Of Birth</b></td>";
            echo "<td>$DOB</td>";
            echo "</tr><tr>";
            echo "<td><b>Photo</b></td>";
            echo "<td>$Photo</td>";
            echo "</tr><tr>";
            echo "<td><b>Reg No</b></td>";
            echo "<td>$RegNo</td>";
            echo "</tr><tr>";
            echo "<td><b>Comments</b></td>";
            echo "<td>$Comments</td>";
            echo "</tr><tr>";
            echo "<td><b>Position</b></td>";
            echo "<td>$Position</td>";
            echo "</tr><tr>";
            echo "<td><b>Games Played</b></td>";
            echo "<td>$GamesPlayed</td>";
            echo "</tr><tr>";
            echo "<td><b>Goals Scored</b></td>";
            echo "<td>$GoalsScored</td>";
            echo "</tr>";
        echo "</table>";
        echo "<br><br>";
    Please help



  2. #2
    Join Date
    Apr 2006
    Denver, Co. USA
    Your code is echo'ing the individual information in the while loop, the while loop ends, then your table code outputs the last data in the table one more time.

    In your code, this is the end of your while loop -
    PHP Code:
    echo "<b>$Forename$Surname</b><br>Date Of Birth: $DOB<br>Nickname: $Nickname<br>Photo: $Photo<br>Reg No: $RegNo
    $Comments<br>Position: $Position<br>Games Played: $GamesPlayed<br>Goals Scored: $GoalsScored <br> <br><hr><br>"
    // <----------------- this is the end of the while loop ---------------
    // the code above this is outputing all the data without a table
    // the code after this is outputing the last set of data a second time, but in the table
    echo "<table style=\"border:1px solid #999999;\" cellspacing=\"3\" cellpadding=\"5\" width=\"70%\" align=\"center\" border=\"0\">"

Posting Permissions

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