2
以下工作(陣列由另一個MySQL查詢填寫):MySQL的
$array=(1,4,5,6,8);
$query=SELECT * FROM table WHERE Id IN(".implode(",",$array)."
但我怎麼可以做以下?:
$array=(
array('Id'=>1, 'Detail1'=>$row['Detail1'], 'Detail2'=>$row['Detail2']),
array('Id'=>4, 'Detail1'=>$row['Detail1'], 'Detail2'=>$row['Detail2']),
array('Id'=>5, 'Detail1'=>$row['Detail1'], 'Detail2'=>$row['Detail2']),
array('Id'=>6, 'Detail1'=>$row['Detail1'], 'Detail2'=>$row['Detail2']),
array('Id'=>8, 'Detail1'=>$row['Detail1'], 'Detail2'=>$row['Detail2']),
);
$query=SELECT * FROM table WHERE Id IN(".implode(",",$array[]['Id'])."
,所以我需要得到所有的ID,我怎麼能在這個多維數組中做到這一點?
謝謝!