#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    13
    Rep Power
    0
    i keep losing the first entry in my results. if there are three entries, say ****, harry, and tom, when i output the results i only get harry and tom, skipping the first entry which is ****. whats wrong with this code:

    $result=mysql_query( "select * from table WHERE name LIKE '%'");

    if ($row = mysql_fetch_array($result)) {
    do{
    print $row["name"];

    } while ($row=mysql_fetch_array($result));
    }

    thanks in advance

    [This message has been edited by jiml (edited April 05, 2000).]
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Annapolis, Maryland US
    Posts
    113
    Rep Power
    16
    Your code seems a bit redundant...

    Try

    $result=mysql_query("select * from TABLE wher e name IS NOT NULL");
    if($result)
    {
    while($row=mysql_fetch_array($result))
    print"$row[name]<br>";
    }

    Hope that's what you're looking for...

Similar Threads

  1. Tell me what's wrong..PHP CODE SIMPLE
    By steral in forum PHP Development
    Replies: 8
    Last Post: February 11th, 2004, 03:48 PM
  2. Replies: 3
    Last Post: February 11th, 2004, 01:33 PM
  3. Ensuring a file's code doesn't cause error in another.
    By Jason Doucette in forum C Programming
    Replies: 0
    Last Post: February 6th, 2004, 12:51 PM
  4. What's wrong w/this code?
    By bubblingangel in forum Visual Basic Programming
    Replies: 2
    Last Post: February 3rd, 2004, 01:24 PM
  5. could you tell what is wrong with this code?
    By skyrtz in forum Visual Basic Programming
    Replies: 3
    Last Post: February 3rd, 2004, 07:32 AM

IMN logo majestic logo threadwatch logo seochat tools logo