pbms_add_metadata
Description
pbms_add_metadata ( string $name, string $value [,resource $pbms] )
Adds the metadata to the connection to be associated with the next BLOB uploaded to the PBMS BLOB streaming server.

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.

Parameters
$name
The name of the metadata field.
$value
The value to be associated with the name.
$pbms
A valid PBMS connection resource. If $pbms is not specified, the last link opened by pbms_connect() is assumed. If no such link is found, it will try to create one as if pbms_connect() was called with no arguments. If by chance no connection is found or established, an E_WARNING level error is generated.
Return Values

Returns TRUE on success.

Returns FALSE on failure. Use pbms_errno() and pbms_error() to retrieve error details.

Example
<?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();
?>
		
Related functions
pbms_clear_metadata() pbms_reset_metadata() pbms_next_metadata() pbms_get_metadata_value()