I am using PHP 5.6.30 with xamp. I am using oracle to connect with some database and using the fetch loop to get all its data one by one.i am using this syntax while (($data = oci_fetch_array($stid, OCI_ASSOC)) != false).
Now inside this while loop i am storing multiple insert queries with ';' separator and after 50 queries of insert, i insert that query into mysql database table using mysqli_multi_query. But i get error: Commands out of sync; you can't run this command.
sample code will be like as below:
while (($data = oci_fetch_array($stid, OCI_ASSOC)) != false)
{
$count ++;
$id = $data['id'];
$name = $data['name'];
$query .= insert into table ('id','name') values('$id','$name');
if(count==50)
{
if(!mysqli_multi_query($dblink ,$insertSQL))
{
echo mysqli_error($dblink);
exit;
}
}