Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

fbsql fetch field function syntax tag tutorial 2013 Donate at flattr Flattr this





Alert! Connect with 10,000 Chating Online. Join Now

Php fbsql fetch field () function

Write your php code

 
<?php ?>

Php Result


Your code below



(PHP 4 >= 4.0.6, PHP 5)

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

Syntax

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().

Php fbsql fetch field Function syntax tag

fbsql fetch field php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php fbsql fetch field syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online