fbsql_fetch_field

fbsql_fetch_field

(PHP 4 >= 4.0.6, PHP 5)

fbsql_fetch_field --  Get column information from a result and return as an object

Description

object fbsql_fetch_field ( resource result [, int field_offset] )

Returns an object containing field information.

fbsql_fetch_field() can be used in order to obtain information about fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by fbsql_fetch_field() is retrieved.

The properties of the object are:

  • name - column name

  • table - name of the table the column belongs to

  • max_length - maximum length of the column

  • not_null - 1 if the column cannot be NULL

  • type - the type of the column

Example 1. fbsql_fetch_field() example

<?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);
?>

See also fbsql_field_seek().



Links
Bluefish $6.95/mo
  • 6GB Diskspace
  • 100GB Bandwidth
  • PHP Perl MySQL SSI CGI SSL
  • Free Domain
  • No Setup Fees
  • No Hidden Fees

HostGator $9.95/mo
  • 100GB Diskspace
  • 1000GB Bandwidth
  • Host Unlimited Domains
  • CPanel
  • PHP CGI SSH SSI
  • Instant Backups
  • 99.9% Uptime Guarantee
  • 30 Day Money Back

AN Hosting $6.95/mo
  • 250GB Diskspace
  • 2500GB Bandwidth
  • Host 20 Domains
  • PHP RoR Python CGI SSI Unlimited MySQL DB
  • Free Domain for Life
  • 30 Day Money Back
  • 99% Uptime Guarantee

Hosting Companies


Partners


Quick Search
Platform

Price

Diskspace

Bandwidth


 Advance Search
 Show All Companies


Reference & Manual

If you are looking for dedicated servers, look no further. HostPulse.com is a site devoted to help web users find cheap web hosting and dedicated servers.


Free Sitemap Generator Host Login/Register | Contact Us | Terms | Add Links
Thumbnails by Thumbshots.org © 2002-2008 CheapHostDir.com