The metadata remains associated with the connection until it is cleared by calling pbms_clear_metadata().
The metadata $name must exist in the PBMS system table 'pbms_metadata_header' before the PBMS BLOB streaming server will store it with the BLOB data. Each database has it's own 'pbms_metadata_header' table which is created automatically the first time it is referenced.
Returns TRUE on success.
Returns FALSE on failure. Use pbms_errno() and pbms_error() to retrieve error details.
<?php pbms_connect(); mysql_connect(); // Let PBMS know about our custom headers we want to store with the BLOB // assuming the names are not already in the pbms_metadata_header table. mysql_query("insert into pbms_metadata_header(name) Values('Header1')"); mysql_query("insert into pbms_metadata_header(name) Values('Blob Name')"); pbms_add_metadata("Header1", "PHPTest"); pbms_add_metadata("Blob Name", "Little BLOB"); $blob_ref = pbms_put_data("A tiny BLOB"); //----------- pbms_get_info($blob_ref); // Get the BLOB info. printf("Header1 = \"%s\"\n", pbms_get_metadata_value("Header1")); printf("PHPTest = \"%s\"\n", pbms_get_metadata_value("PHPTest")); mysql_close(); pbms_close(); ?>