$say = mysql_num_rows(mysql_query("select id from tabloadı where id='$gelenid'")); if ( $say == 0 ){ header("location:404.html"); }