I'm looking for an easy query/bit of php code that can tell me if a certain value occurs in a table.
Right now the best idea I have is
$query = "select * from table1 where value=4";
$result = @($query);
if(@mysql_num_rows($result))
{
value occurs;
}
else
{
value does not occur;
}
Is there a better way to do this? Thanks.