The header file of ‘mysql.h’ must be included in the reference header file (must be the absolute address of mysql.h, generally in the include directory under mysql, take a closer look at where you are?*), I Is ubuntu9.04, some Linux versions under /usr/include/mysql/mysql.h may be under /usr/local/mysql/include/mysql/mysql.h.
---- For a brief description of several of these functions, please refer to the MySQL documentation for details:
---- 1. MYSQL *mysql_init(MYSQL *mysql)
---- Initialize a data structure of type MYSQL to prepare for executing mysql_real_connect(). Parameters
mysql is a pointer to the structure. If mysql is NULL, create and initialize a MYSQL data structure.
The newly created structure will be released in mysql_close().
---- If successful, return a pointer to the initialized MYSQL data structure, otherwise return NULL.
---- 2. MYSQL *mysql_real_connect(MYSQL *mysql, const char *host,
---- const char *user, const char *passwd, const char *db,
---- unsigned int port, const char *unix_socket, unsigned int client_flag)
---- Establish a connection with the MySQL database engine. Before performing further data operations, you must ensure that mysql_re
al_connect() returns successfully.
---- The parameter mysql is the return value of mysql_init();
---- The parameter host is the TCP/IP host name of the machine running the MySQL database engine, if NULL The default is “lo
calhost”;
---- The parameters user and passwd are the legal user and password of the MySQL database;
---- the parameter db is The database name of the connection;
---- The parameters port, unix_socket and client_flag generally take the default value.
---- 3. int mysql_query(MYSQL *mysql, const char *query)
---- Execute the SQL statement in the query string, the query must end with 0. Returns 0 if successful.
---- 4. MYSQL_RES *mysql_store_result(MYSQL *mysql)
---- Returns the result of SELECT, SHOW, DESCRIBE, EXPLAIN and other statements. The function creates a new MYSQL_
RES data structure and stores the result in the structure. If the query has no matching results, an empty data set is returned.
After processing the result set, you must call mysql_free_result().
---- If there is an error, return NULL, otherwise return a pointer to the MYSQL_RES structure.
---- 5. MYSQL_ROW mysql_fetch_row(MYSQL_RES *result)
---- Retrieve the next record in the result set, or NULL if there are no records or errors. The number of fields in a record
can be obtained with mysql_num_fields(result). The value of each field can be arrayed from row[0] to row[mysql_nu
m_fields(result)-1] access.
---- In the link option of the project, add the interface library of c:mysqlliblibmysql.lib, copy libmysql.d
ll to the system of operating system
Under the directory (c:winntsystem32), you can compile and run.
---- At this point, a simple database application is developed. Of course, MySQL has a feature-rich AP
I, and you can view the documentation. In addition, if you need cross-platform portability, you can consider using MySQL's ODBC interface
. You can configure the ODBC connection properties of MySQL yourself, or you can download the myodbc-2.50.29-nt.zip toolkit to match
1.LinuxOSVersion:RedHat AS 52. Network Environment Settings: Host (Linux): IP: 192.168.1.1 NetMark:
Under Linux is a regular software installation method in addition to binary form of software distrib
There are WINDOWS on the computer and LINUX Some people like GRUB, and some people like NT Loader to
The network is often dropped. Many technicians think that the router is unstable. The ac
Linux command line knowledge: apropos command parameters and usage introduction
Preparation before Linux system installation
SSH common commands under Linux VPS
Yum from the mount CD or ISO installation basic tutorial
Linux system master road kernel compilation process analysis
Linux Network Operation Command Encyclopedia
Linux common tips: teach you the same network card configuration multiple IP
Nine rules for Linux system security
Linux forced delete non-empty directory command
Win8.1 can not install the KB2825630 patch solution
Windows8 installation tutorial (3)
How to install a Windows Server 2003 image to Windows Server 2003 RIS
What if Win10 IE cannot display pictures?
Display Close Restore Win 7 Taskbar Tip
Windows 7 system can not run the program emergency method (2)
How to create a broadband connection and setting method in Windows 8
Microsoft questioned Windows 7 zero-day vulnerability causing crashes
Clear Win 7 to automatically track the games users have played