i have a little question here... i have a PHP array like this..
Array
(
[0] => Array
(
[idCustomer] => 2553
[session] =>
[noMobil] => 666
[keterangan] => Sistem
[tahun] => 2012
[merk] => Sistem
)
[1] => Array
(
[idCustomer] => 2553
[session] =>
[noMobil] => 7777
[keterangan] => hahahaha
[tahun] => 2120
[merk] =>
)
)
And i stored that array to **$_SESSION[datamobil]**
..
and then my question is.. how to populate that array into selectbox using jquery.. so the select box is like this..
<select id='mobil' name='mobil'>
<option> - PILIH MOBIL - </option>
<option value='666'>666</option>
<option value='7777'>7777</option>
</select>
and when i select one of that selectbox option.. it will populate the detail element... like this
selectbox : [-- 666 --] <-- the selectbox
- Detail -
keterangan : Sistem
tahun : 2012
merk : Sistem
any one can help me?? thanks before
EDIT :
a code to get the array..
$query = "SELECT * FROM customer_car WHERE idCustomer = '$_SESSION[idCustomer]'";
$go = $db->query($query);
$mobil_array = array();
while($car = $go->fetchAll(PDO::FETCH_ASSOC))
{
$mobil_array = $car;
}
$_SESSION[datamobil] = $mobil_array;