How can I show only name and lastname for mecanicien?
$aMecaniciens = array(
array(
"idMecanicien"=>1,
'vchNomMecanicien'=>"Guérand",
'vchPrenomMecanicien'=>"Bob"
),
array(
"idMecanicien"=>2,
'vchNomMecanicien'=>"Lim",
'vchPrenomMecanicien'=>"Bao"
),
array(
"idMecanicien"=>3,
'vchNomMecanicien'=>"Cadoret",
'vchPrenomMecanicien'=>"Cadoret"
)
);
foreach ($aMecaniciens as $value) {
foreach ($value as $key) {
echo "<option value=\"value\">$key[1].$key[2]</option>";
}
}
$key[1], but the arrays are not with a numbered index. Try using$key['vchNomMecanicien']instead.$keydoes not hold the inner array, it holds things likeGuérandand3.