"Jamie" <[EMAIL PROTECTED]> wrote:
> $results = mysql_query("SELECT option_type, code FROM options WHERE
> code='000' ORDER BY option_type",$db);
>  mysql_fetch_array($results);
> // From what  understand I should have an array some thig like this:
> // ("Size"=>"A4" , "Size" => "A3", "Size"=>"A5", "Colour"=>"Red", etc..);

According to your SQL statement that doesn't appear to be true.  According
to your SQL statement you'll return two fields: option_type and code.

>  $types = array_values($results);
> // OK so now I think I have an array like this:
> // ("A4" , "A3", "A5", "Red", etc..);
>   while ($type =array_pop($types)){
>    echo $type."<br>";
>  }

I'd avoid using array_values() and array_pop().  Simply do this:

while ( $row = mysql_fetch_array( $result ) )
    {
    $option_type = $row[option_type];
    $code = $row[code];
    echo "$option_type $code<br>";
    }

Hopefully that'll be enough to get you going.

--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to