$ids_str=$_GET['ids'];
$id=explode(",",$ids_str);
var_dump($id);
if(isset($id)){
for ($i=0;$i<=count($id);$i++)
{
$sql="UPDATE `pharm_cart_order`.cart_inventory_temp ";
$sql.="SET print_flag=1 ";
$sqlWhere="WHERE id='$id'.['$i'] ";
$sql.=$sqlWhere;
$result= mysql_query($sql);
}
echo "<font color='red'> Records were marked as printed.</font>\n";}
I get this error message. It is the sqlWhere line. How do you do the array notation for the for loop?
Received: array(5) { [0]=> string(5) "41158" [1]=> string(5) "41159" [2]=> string(5) "41160" [3]=> string(5) "41161" [4]=> string(5) "41176" } Invalid query:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.['0']' at line 1
It is a little hard to understand what I am doing but the echoed line is a responseTEXT for an xmlHTTP request. That part works except I don't have the UPDATE happening correctly.Thanks,