Page 1 of 3 123 LastLast
Results 1 to 10 of 28
  1. #1
    Join Date
    Apr 2006
    Location
    London, England
    Posts
    696
    Tokens
    0

    Default While loop problem

    I have checked and checked so many times and i can't see why this is happening!

    PHP Code:
    $skin mysql_query"SELECT id,path,name,description,author FROM skins ORDER BY id ASC LIMIT 10" ); 
    PHP Code:
    while( $list mysql_fetch_array$skin ) ) 

    {

        echo 
    "variables and stuff";



    Now technically speaking it should display what i want in the while loop 10 times in an ascending order. However i have 3 rows in the table and it is currently displaying 2 / 3.

    So the latest entry is being missed out for some reason and i can't work out why this is :S
    ;veni vidi vici
    ;i came, i saw, i ownt

  2. #2
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Can't see why it's happening, are you actually echoing the loop variable?
    Back for a while.

  3. #3
    Join Date
    Apr 2006
    Location
    London, England
    Posts
    696
    Tokens
    0

    Default

    yes i am. Stuff like:

    PHP Code:
    echo $list'name' ]
           
    $list'path' ]
           
    $list'description' ]
           
    $list'author' ]; 
    It works for 2 of the entries but as i said the latest entry doesn't show.
    ;veni vidi vici
    ;i came, i saw, i ownt

  4. #4
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    I had this problem when I was making a private messaging system, can't for the life of me remember how I fixed it though.. I suggest you just go over your code, checking all the obvious things, or maybe try a new way of displaying it, sorry I couldn't be of much more help.
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  5. #5
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Check your PMA for db entries?
    Back for a while.

  6. #6
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    while( $list mysql_fetch_assoc$skin ) ) 

    {

        echo 
    "variables and stuff";


    I think
    Lets set the stage on fire, and hollywood will be jealous.

  7. #7
    Join Date
    Apr 2006
    Location
    London, England
    Posts
    696
    Tokens
    0

    Default

    well actually i did try that with:

    PHP Code:
    while( $list mysql_fetch_array$skinMYSQL_ASSOC ) ) 

    {

        echo 
    "variables and stuff";


    But still did the same thing
    ;veni vidi vici
    ;i came, i saw, i ownt

  8. #8
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Check your PMA?
    Back for a while.

  9. #9
    Join Date
    Apr 2006
    Location
    London, England
    Posts
    696
    Tokens
    0

    Default

    the table for skins is:

    Code:
    id     path               name                  description             author
    1     default          Default            default skin             me
    2     dark             dark skin           Dark skin                me
    3     light             light skin           Light skin               me
    Last edited by DUB; 29-09-2008 at 07:19 PM.
    ;veni vidi vici
    ;i came, i saw, i ownt

  10. #10
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Try this, probably wrong.

    PHP Code:
    $skin mysql_query"SELECT * FROM `skins` ORDER BY `id` ASC LIMIT 10" ); 

    while( 
    $data mysql_fetch_array$skin ) {
            echo 
    $data['description'];


    You get the idea


    www.fragme.co = a project.

Page 1 of 3 123 LastLast

Posting Permissions

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