Check if a record exist in a specific table of database in MySQL

You can check if a record exist in a specific table of database in MySQL with the code block below:

if(mysql_num_rows(mysql_query("SELECT * FROM reports WHERE reportID = '$reportNUM'"))){
// Code inside if block if reportID is already there
}