How it works...

We will start by invoking the mysql_init function to initialize a MYSQL object by the name conn. We will then pass the MYSQL object conn to the mysql_real_connect function that we invoked to establish a connection to the MySQL server running at the specified host. Several other parameters will also be passed to the mysql_real_connection function, including a valid user ID, password, host details, and the database with which we want to work. The mysql_real_connect function will establish a connection to the MySQL server running at the specified host and will declare a MYSQL object conn as the connection handler. This means thar conn can connect to the MySQL server and the commerce database wherever it is used.

The program will ...

Get Practical C Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.