Fetch a record in a table pointed by a key.
Prototype:
The function get the record pointed by $key in table indentified by $handle. The arguments $key_number specifies if the search must be executed on a specify key (0…n). Value 0 is PRIMARY KEY. If $key_number is not specified the engine use first key type with same length of $key.
RETURN: The function returns a string with record data or FALSE if an error occurred. You can use mfcdb_error() to get string description of error code.
<?php $resource = mfcdb_open("mydatabase"); if($resource == FALSE) { die("An error occurred opening table, error is: ".mfcdb_error()."\n"); } $data = mfcdb_fetch($resource, "256", 0); if($data == FALSE) { echo "Error fetching data, error is: ".mfcdb_error()."\n"; } else { echo "DATA: ".print_r($data, true)."\n"; } if(mfcdb_close($resource) == FALSE) { die("An error occurred closing table, error is: ".mfcdb_error()."\n"); } ?>