<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    Chapter 8:  MySQL APIs 573 8.4.3.17  mysql_fetch_field_direct() MYSQL_FIELD *mysql_fetch_field_direct(MYSQL_RES *result, unsigned int fieldnr) Description Given a eld number fieldnr for a column within a result set, returns that column's eld de nition as a MYSQL_FIELD structure.  You may use this function to retrieve the de nition for an arbitrary column.  The value of fieldnr should be in the range from 0 to mysql_ num_fields(result)-1. Return Values The MYSQL_FIELD structure for the speci ed column. Errors None. Example unsigned int num_fields; unsigned int i; MYSQL_FIELD *field; num_fields = mysql_num_fields(result); for(i = 0; i < num_fields; i++) { field = mysql_fetch_field_direct(result, i); printf("Field %u is %s\n", i, field->name); } 8.4.3.18  mysql_fetch_lengths() unsigned long *mysql_fetch_lengths(MYSQL_RES *result) Description Returns the lengths of the columns of the current row within a result set.  If you plan to copy eld values, this length information is also useful for optimisation, because you can avoid calling strlen().  In addition, if the result set contains binary data, you must use this function to determine the size of the data, because strlen() returns incorrect results for any eld containing null characters. The length for empty columns and for columns containing NULL values is zero.  To see how to distinguish these two cases, see the description for mysql_fetch_row().
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    MERCHANT ACCOUNTS
    DEDICATED SERVERS
    E-COMMERCE HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN
    REGISTRATION
    MANAGE
    YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    Corporate Info
    ABOUT US
    OUR NETWORK
    CONTACT US
    SITE MAP
    Copyright © 2002 Dyntex Group, Inc. All Rights Reserved
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide