Codice PHP:<?php
$query = mysql_query("select id from tabella");
$query_max = mysql_query("select id as massimo from tabella order by id desc LIMIT 1");
$massimo = mysql_result($query_max,0,'massimo');
$presenti = array();
$mancanti = array();
while ($row = mysql_fetch_array($query) )
{
$id = $row['id'];
array_push($presenti,$id);
}
for ($i=1;$i<=$massimo;$i++)
{
if(!in_array($i,$presenti))
array_push($mancanti,$i);
}
echo "Record mancanti:
";
foreach($mancanti as $valore)
echo "$valore
";
?>![]()

Rispondi quotando