<? if(mysql_num_rows($res)==0) header("location: sindatos.php"); if(mysql_num_rows($res)>0) que haga lo que quieres ?>