primo errore
$row_number <> 0 in php non vuol dire "diverso" , quindi sostituisci con
if ( $row_number != 0 ){