<?php
$data = "data to check";
// check to see if the data is in SQL
$sql = mysql_query("SELECT data from tablename
WHERE data = '$data'
LIMIT 1") or die(mysql_error());
if(mysql_num_rows($sql) <> 0) {
// data was found
} else {
// data was not found
}
?>
make sure you have <?php and ?>