Yes you want something like this:
PHP Code:
//Next check that the petname does not already exist...
$flag = 0;
$query = "SELECT * FROM ".$prefix."adopts WHERE petname = '$petname'";
$result = @mysql_query($query);
$num = @mysql_numrows($result);
if($num > 0){
$flag = 1;
}
if($flag > 0){
//petname already exists
$article_title = "Your petname already exists";
$article_content = "Your name exists currently in our database. Please try again and choose a different name.";
}
Of course just change username, and the directory your calling from.