View Single Post
  #2  
Old 07-04-2009, 11:31 AM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 44,813
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: One adoptable per name?

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.
Reply With Quote