Codice PHP:
<?php
error_reporting(E_ALL);
function exception_handler($exception) {
if ( strstr( $exception->getMessage(), 'Error while sending QUERY packet' ) !== FALSE ) {
header( 'Location: ' . basename( __FILE__ ) );
exit( 1 );
}
}
set_exception_handler('exception_handler');
// ... Connessione al database ...
delete:
$pdo->query("DELETE FROM nome-tabella WHERE 1 = 1 LIMIT 200"); //riga 53
$q = "select id from nome-tabella";
$result = $pdo->query($q);
$codice2 = $result->fetchColumn();
if (!empty($codice2))
{
sleep(1);
goto delete;
}
Ciao, fammi sapere!