<?php
fbsql_connect($host, $user, $password)
or die("Could not connect");
$result = fbsql_db_query("database", "select * from table")
or die("Query failed");
# get column metadata
$i = 0;
while ($i < fbsql_num_fields($result)) {
echo "Information for column $i:<br />\n";
$meta = fbsql_fetch_field($result);
if (!$meta) {
echo "No information available<br />\n";
}
echo "<pre>
max_length: $meta->max_length
name: $meta->name
not_null: $meta->not_null
table: $meta->table
type: $meta->type
</pre>";
$i++;
}
fbsql_free_result($result);
?>