08-04-2009, 11:39 PM
|
#2 (permalink)
|
|
The Addict
Join Date: Aug 2008
Posts: 336
Thanks: 8
|
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.
|
|
|
|