FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


HomeWatched TopicsRegisterSearchDirectory
FAQMemberlistUsergroupsLog inStoresItemsBank
Google

Reply to topic Page 1 of 1
Retrieving mulitple values in a while statement
Message  

Reply with quote
Post Retrieving mulitple values in a while statement 
I would like to also retrieve manufacturer and serial number when I submit the form showing the computer model in a FAVORITES pulldown list:

<select name="model" style="width: 300px;">
<?

$query=mysql_query("SELECT * FROM laptop WHERE model='$model' and

favorite='favorite'") or die(mysql_error());

while ($row = mysql_fetch_array($query)) {
$j = mysql_num_fields($query);
        for($i=0;$i<$j;$i++) {
            $k = mysql_field_name($query,$i);
            $$k = $row[$k];

        }
echo "<option value =\"$row[model]\">$row[model] </option>\n";


}
?>
</select>

When I submit this form, I want to also insert, the $make and $serial from the row. This is to reduce entering repetitve data on frequently used laptop models, thanks.

View user's profile Send private message

Reply with quote
Post  
Well to accomplish this I wouldnt do it when displaying the form.. I would just do it when you process the form.

View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger

Reply with quote
Post Multiple Values 
Thanks Outkast, but I posted the same question in "The PHP Lounge" and Maloid helped supply the remedy. Thanks for your response.

View user's profile Send private message

Reply with quote
Post  
No problem.. that is what I am here for.. to help! Smile

View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  



Google

FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


Web Design by PlatinumShore.com & Web Hosting by TradeWebHosting.com