DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info.gz) mysql_init

Info Catalog (mysql.info.gz) mysql_info (mysql.info.gz) C API functions (mysql.info.gz) mysql_insert_id
 
 22.2.3.32 `mysql_init()'
 ........................
 
 `MYSQL *mysql_init(MYSQL *mysql)'
 
 Description
 ...........
 
 Allocates or initializes a `MYSQL' object suitable for
 `mysql_real_connect()'.  If `mysql' is a `NULL' pointer, the function
 allocates, initializes, and returns a new object.  Otherwise, the
 object is initialized and the address of the object is returned.  If
 `mysql_init()' allocates a new object, it will be freed when
 `mysql_close()' is called to close the connection.
 
 To avoid a memory leak, use the following procedure, which should be
 done whether the application is linked with the `libmysqlclient' or
 `libmysqld' library:
 
    * Call `mysql_library_init()' before the first call to `mysql_init()'
 
    * Call `mysql_library_end()' after the application has closed any
      open connections and is done using the MySQL C API.
 
    * If you like, the call to `mysql_library_init()' may be omitted,
      because `mysql_init()' will invoke it automatically as necessary.
 
 
  `mysql_library_init()' mysql_library_init.  
 `mysql_library_end()' mysql_library_end.
 
 Return Values
 .............
 
 An initialized `MYSQL*' handle.  `NULL' if there was insufficient
 memory to allocate a new object.
 
 Errors
 ......
 
 In case of insufficient memory, `NULL' is returned.
 
Info Catalog (mysql.info.gz) mysql_info (mysql.info.gz) C API functions (mysql.info.gz) mysql_insert_id
automatically generated byinfo2html