I try to execute a very simple query to delete one row. the "max_allowed_packet" equals "1073741824" that's why I'm confused why I get
Error while sending QUERY packet. PID=2
I select just 25 rows from a table to send their data via sms and sleep(1) after deleting the row.
Query:
$stmt = $db->prepare("select * from sms limit 25");
$stmt->execute();
I loop through rows here and send row data via sms then delete it
$q = $db->prepare("delete from sms where id = '$r[id]'");
$q->execute();
sleep(1)
But sometimes (just sometimes not every time) I get that error and row doesn't get deleted so the sms message is sent so many times to the same user because it's still in the table. Any ideas to solve this?
Thanks in advance.