Rate this script:  I Love it  /   I Hate it

Record Exists


Code


function recordExists($id,$idval,$table,$db) {//check for id=idval in table and return TRUE or FALSE
   $result = mysql_query("SELECT * FROM ".$table." WHERE ".$id."='".$idval."'", $db) or die(mysql_error());
   if($row = mysql_fetch_array($result)) {//if we did return a record
      return 1;
   }//end if row
   return 0;
}//end fuction recordExists
 

 

 
Record Exists scripts | Record Exists snippet | Record Exists example | Record Exists tutorial | Record Exists code