What is the right way of checking if the required data is in the database?
What I use currently is,
mysql_query("SELECT anyfield FROM table WHERE field='$data'");
and then check the if any rows are affected.
But I dont really have any use with the extracted data anyfield
.
Eventhough the resource usage is so minor here, what is the right way to check if data exists in a db without extracting any other fields from the table?