<< 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 591 CR_VERSION_ERROR A protocol mismatch resulted from attempting to connect to a server with a client library that uses a di erent protocol version.  This can happen if you use a very old client library to connect to a new server that wasn't started with the --old-protocol option. CR_NAMEDPIPEOPEN_ERROR Failed to create a named pipe on Windows. CR_NAMEDPIPEWAIT_ERROR Failed to wait for a named pipe on Windows. CR_NAMEDPIPESETSTATE_ERROR Failed to get a pipe handler on Windows. CR_SERVER_LOST If connect_timeout > 0 and it took longer then connect_timeout seconds to connect to the server or if the server died while executing the init-command. Example MYSQL mysql; mysql_init(&mysql); mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"your_prog_name"); if (!mysql_real_connect(&mysql,"host","user","passwd","database",0,NULL,0)) { fprintf(stderr, "Failed to connect to database: Error: %s\n", mysql_error(&mysql)); } By using  mysql_options()  the MySQL library will read the  [client]  and  your_prog_ name  sections in the `my.cnf' le which will ensure that your program will work,  even if someone has set up MySQL in some non-standard way. Note that upon connection,  mysql_real_connect() sets the reconnect  ag (part of the MYSQL structure) to a value of 1.  This ag indicates, in the event that a query cannot be performed because of a lost connection, to try reconnecting to the server before giving up. 8.4.3.42  mysql_real_escape_string() unsigned long mysql_real_escape_string(MYSQL *mysql, char *to, const char *from, unsigned long length) Description This function is used to create a legal SQL string that you can use in a SQL statement.  See Section 6.1.1.1 [String syntax], page 376. The string in from is encoded to an escaped SQL string, taking into account the current character set of the connection.  The result is placed in to and a terminating null byte is
     

    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