How it works...
We will start by establishing a connection with the MySQL server and for that, we need to invoke the mysql_real_connect function. But we have to pass a MYSQL object to the mysql_real_connect function and we have to invoke the mysql_init function to create the MYSQL object. Hence, the mysql_init function is first invoked to initialize a MYSQL object by the name conn.
We will then supply the MYSQL object conn to the mysql_real_connect function, along with the valid user ID, password, and the host details. The mysql_real_connect function will establish a connection to the MySQL server running at the specified host. Besides this, the function will link to the supplied mysql database and will declare conn as the connection handler. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access