Move mysql_fetch_array() inside of if { ... }