www.webdeveloper.com
Results 1 to 4 of 4

Thread: [RESOLVED] query results only giving second last row

  1. #1
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    125

    resolved [RESOLVED] query results only giving second last row

    Hi,

    Having a weird issue here. Just trying to query a table for a list of files and echo the results, but for some reason, I'm only getting the second last row, regardless of how many files are in the table. This is pretty basic, can't see where the problem is

    PHP Code:
    $newf mysql_query("SELECT * FROM UploadedFiles");
    while (
    $new mysql_fetch_array($newf)) {
            echo 
    '<p><a href="ed1.php?name=' . ($new['name']) . '>' . ($new['name']) . '</a></p>';

    Any thoughts?

    Thanks

  2. #2
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    Missing a closing quote, otherwise it looks fine:

    Code:
    $newf = mysql_query("SELECT * FROM UploadedFiles");
    while ($new = mysql_fetch_array($newf)) {
            echo '<p><a href="ed1.php?name=' . ($new['name']) . '">' . ($new['name']) . '</a></p>';
    }

  3. #3
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    125
    Oops. Found it. Missing double quote....

  4. #4
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    125
    haha thanks. Just saw that myself.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles