The Combo-box in the update form page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
minos_mks
Forum Commoner
Posts: 69
Joined: Thu Feb 04, 2010 1:58 am

The Combo-box in the update form page

Post by minos_mks »

i have an entry page and it has one combo-box to make the user select the car model and this is the code for the combo-box :

<td bgcolor="#Ff6600">Model</td>
<td><select name="model">
<?php
$cars_models=select_cars_models(cars_models);
$model = mysql_fetch_assoc($cars_models);
do {
?>
<option value="<?php echo $model['cars_marke_code']?>"><?php echo $model['cars_model_name']?></option>
<?php
} while ($model = mysql_fetch_assoc($cars_models));
// $models = mysql_num_rows($model);
if($models > 0) {
mysql_data_seek($model, 0);
//$row_Recordset1 = mysql_fetch_assoc($model);
}
?>
</select></td>

as you see in the previous code the data of the combo-box comes from the (select_cars_models) and this function get the data from the (cars_model) table which have all the cars model and and all the field in this form including the car_model combo-box save the data in (add_d_cars) table and that's what i need here

BUT

Now i need to make other page has a form to update the records and save it agin to (add_d_cars) table so i need to things

1- when i get the data from the (add_d_cars) table to the page including the data of the car_model which it's mean the car model of this recored
2- when the user click on this combo-box to update the car_model it should get the data from (cars_model) table

so how i can change the source of the query on fly ??!!
minos_mks
Forum Commoner
Posts: 69
Joined: Thu Feb 04, 2010 1:58 am

Re: The Combo-box in the update form page

Post by minos_mks »

please, i need to fix this problem
Post Reply