Codice PHP:
while($row mysql_fetch_assoc($datab))
{
// qui metti il codice per la prima volta
$tmp[] = $row// qui salviamo tutti i dati in array