Verify if a record exists in a table
Prototype:
The function verify if a record exists in a table. The record is pointed by $key and the table is identified by $resource. An optional argument $key_number forces the search on a specified key (0…n) where value 0 is PRIMARY KEY.
RETURN: The function returns TRUE if record exists or FALSE.
<?php $resource = mfcdb_open("mydatabase"); if($resource == FALSE) { die("An error occurred opening table, error is: ".mfcdb_error()."\n"); } $key = "42"; if(mfcdb_exists($resource, $key)) { echo "The record with key :".$key." exists\n"; } else { echo "The record with key :".$key." not exists\n"; } if(mfcdb_close($resource) == FALSE) { die("An error occurred closing table, error is: ".mfcdb_error()."\n"); } ?>