Query: maxdb_field_tell
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
MAXDB_FIELD_TELL(3) 1 MAXDB_FIELD_TELL(3) maxdb_field_tell - Get current field offset of a result pointer Procedural styleSYNOPSISint maxdb_field_tell (resource $result)DESCRIPTIONObject oriented style int$maxdb_result->current_field () Returns the position of the field cursor used for the last maxdb_fetch_field(3) call. This value can be used as an argument to maxdb_field_seek(3).RETURN VALUESReturns current offset of field cursor.EXAMPLESExample #1 Object oriented style <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } $query = "SELECT name, cno from hotel.customer ORDER BY cno"; if ($result = $maxdb->query($query)) { /* Get field information for all columns */ while ($finfo = $result->fetch_field()) { /* get fieldpointer offset */ $currentfield = $result->current_field; printf("Column %d: ", $currentfield); printf("Name: %s ", $finfo->name); printf("Table: %s ", $finfo->table); printf("max. Len: %d ", $finfo->max_length); printf("Flags: %d ", $finfo->flags); printf("Type: %d ", $finfo->type); } $result->close(); } /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } $query = "SELECT name, cno from hotel.customer ORDER BY cno"; if ($result = maxdb_query($link, $query)) { /* Get field information for all fields */ while ($finfo = maxdb_fetch_field($result)) { /* get fieldpointer offset */ $currentfield = maxdb_field_tell($result); printf("Column %d: ", $currentfield); printf("Name: %s ", $finfo->name); printf("Table: %s ", $finfo->table); printf("max. Len: %d ", $finfo->max_length); printf("Flags: %d ", $finfo->flags); printf("Type: %d ", $finfo->type); } maxdb_free_result($result); } /* close connection */ maxdb_close($link); ?> The above example will output something similar to: Column 1: Name: NAME Table: max. Len: 10 Flags: -1 Type: 2 Column 2: Name: CNO Table: max. Len: 4 Flags: -1 Type: 0SEE ALSOmaxdb_fetch_field(3), maxdb_field_seek(3). PHP Documentation Group MAXDB_FIELD_TELL(3)
Related Man Pages |
---|
maxdb_fetch_field(3) - php |
maxdb_data_seek(3) - php |
maxdb_fetch_fields(3) - php |
mysqli_fetch_field_direct(3) - php |
mysqli_field_seek(3) - php |
Similar Topics in the Unix Linux Community |
---|
Create Shellscript |
AwK printf question |
Column query |
URGENT!! please help |
Putting values into order in a field using awk |