There’s nothing necessarily wrong with what you’re doing, it’s just a little bit inefficient (since it has to retrieve and loop through EVERYONE’s email address).
If you want to check if a specific address exists, you can SELECT email FROM table WHERE email = ‘thevalueyouwanttocheck’ , and then use mysql_num_rows to determine it (if it’s 1, the email exists, otherwise it will be 0)
(NOTE: If you do this, sanitize the post variable before using it in a query!)
As far as your query, your problem is a question of rows
It seems you are trying to check the posted email address is already exists or not and do the action accordingly. Retrieving all records and loop through the whole rows to check is not the proper and good way. Do something like this:
$email = mysql_real_escape_string($_POST['email']);
$result = mysql_query("SELECT email FROM tblnema WHERE email='$email'") or die(mysql_error());
if(mysql_num_rows($result) >= 1){
$message = Press::insertPressUserApproved();
}
else{
$message = Press::insertPressUser();
}