mfcdb_delete

Delete a record in table


Prototype:

boolean mfcdb_delete( resource $handle, string $primary_key )




This function deletes the record pointed by primary key $primary_key in table identified by $handle. The key must be unique (primary key).

RETURN: This function returns TRUE if deletion is good or FALSE. You can get string error message with mfcdb_error()

Example

<?php
$resource = mfcdb_open("mydatabase");
 
if($resource == FALSE) {
  die("An error occurred opening table, error is: ".mfcdb_error()."\n");
}
 
$key = "42";
$result = mfcdb_delete($resource, $key);
 
if($result == FALSE) {
  echo "An error occurred while inserting record, error is: ".mfcdb_error()."\n";
} else {
  echo "Inserted record ".$result."\n";
}
 
 
if(mfcdb_close($resource) == FALSE) {
  die("An error occurred closing table, error is: ".mfcdb_error()."\n");
}
 
?>
documentation/mfcdb_delete.txt · Ultima modifica: 2008/08/22 23:31 da gchiesa