Replace a record in table of database
Prototype:
This function in table identified by $handle, replace existing record pointed by $key with $new_record. The engine takes care of updating each key associated to record.
RETURN: The function returns TRUE or FALSE
<?php $resource = mfcdb_open("mydatabase"); if($resource == FALSE) { die("An error occurred opening table, error is: ".mfcdb_error()."\n"); } $data = "42newfoobar"; $key = substr($data, 0, 2); $result = mfcdb_replace($resource, $key, $data); 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"); } ?>