i want to update query from array.the problem is when i ran the code, the updated data in the database just the first data..
example..
the array consist of integer type = [1,2]
when i ran the code, the data in the database just ran the first data (only 1)..how can i fix this?
PHP file
$query_edit_paket = "select nama_menu from menu where id_menu = 149 ";
$query_exec_edit_paket = mysql_query($query_edit_paket) or die(mysql_error());
$nama_menu_query = reset(mysql_fetch_assoc($query_exec_edit_paket));
$_fbexclude = mysql_query("select id_paket from detail_paket where menu_paket = '$nama_menu_query' ");
$fbexcludearray = array();
while ($row = mysql_fetch_assoc($_fbexclude)) {
$fbexcludearray[] = $row['id_paket'];
}
$excludes = implode(',', $fbexcludearray);
echo $excludes;
for($i=0;$i<count($excludes);$i++)
{
if($excludes != "")
{
$strSQL = "update paket set ketersediaan_paket ='kosong' ";
$strSQL .="WHERE id_paket = '$excludes' ";
$objQuery = mysql_query($strSQL);
}
}
thanks!!
Try using
INchange
to