View Single Post
Old 08-05-2009, 12:32 AM   #3 (permalink)
russellharrower
The Contributor
 
russellharrower's Avatar
 
Join Date: Jul 2009
Posts: 80
Thanks: 13
russellharrower is on a distinguished road
Default

Quote:
Originally Posted by tony View Post
you can try the mysql_num_rows() function like this:
php Code:
$result = mysql_query('SELECT recordID FROM fruits WHERE name="apple"');
if(mysql_num_rows($result) > 0 {
    //error, apple already exists
}else{
    //congrats! you added an apple to the basket.
}

I should encourage you (me too) to use mysqli objects for security reasons, but I need to learn it myself too.
Yes you are correct it is a lot better to use mysqli however some servers don't seem to turn them on, due to and if you ask me this is silly...

CPU useage apparently it takes up to much? That was the excuse my server hosting company said. After tell them I leave to go somewhere else they turned it on for my account.
russellharrower is offline  
Reply With Quote