mysql query not collecting ll data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anfetienne
    Contributor
    • Feb 2009
    • 424

    mysql query not collecting ll data

    hi i have a db that has multiple rows inserted into it and no auto_increment. now to retrieve I am trying to use the code below to select all data from one column according to the tempID and order them by the imageNo but it is only selecting the 1st row......is this because i have no auto_increment?

    Code:
    mysql_connect($hostname,$username,$password);
    @mysql_select_db($database) or die( "Unable to select database");
    
    $capSQL = "SELECT imageCap FROM flashGallery WHERE tempID = '{$random_digit}' ORDER BY imageNo";
    $capRES = mysql_query( $capSQL ) or die( mysql_error );
    
    if ( mysql_num_rows( $capRES ) > 0 )
    {
    $caps = mysql_fetch_array( $capRES );
    print_r($caps);
    }
    
    mysql_close();
  • anfetienne
    Contributor
    • Feb 2009
    • 424

    #2
    i guess not....i've just tried a SELECT * and it only returns the 1st row. think i know what i need to do

    Comment

    • anfetienne
      Contributor
      • Feb 2009
      • 424

      #3
      i've done it, i used a function i found for selecting multiple rows

      Comment

      Working...