Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    1

    Unhappy Unanswered: retrieving my data newb :(

    well ive got my database set up an stuff an my form sends it to the mysql database then on the page i want to print my results it wont print the first one unless i put a second one in can someone correct my script if its wrong

    <?php
    $conn = mysql_connect("localhost", "username");
    mysql_select_db("databasename", $conn);

    $upd = mysql_query("SELECT admin, date, title, comments FROM base order by id desc limit 10");
    while ($row = mysql_fetch_row($upd))
    while ($article = mysql_fetch_array($upd))
    {

    echo
    '<table border=1 width=400 align=center>
    <tr>
    <td><LEFT><p>'.$article["admin"].'</p></LEFT>
    </td>
    <td><RIGHT><p>'.$article["date"].'</p></RIGHT>
    </td>
    </tr>
    <tr>
    <td colspan=2><p>'.$article["title"].'</p>
    </td>
    </tr>
    <tr>
    <td colspan=2><p>'.$article["comments"].'</p>
    </td>
    </tr>
    </table><br><br>';
    }

    ?>

    someone reply plzzzzzz in need of help

  2. #2
    Join Date
    Jun 2004
    Posts
    7
    I would assume your first while loop just loops within itself and always just ends on the last record. Why don't you put some {} around it and entire other one, no?

Posting Permissions

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