How it works...
We start by invoking the mysql_init function to initialize a MYSQL object by the name conn. The initialized MYSQL object conn is then supplied for invoking the mysql_real_connect function, along with the valid user ID and password, which in turn will establish a connection to the MySQL server running on the localhost. In addition, the function will link to our ecommerce database.
If any error occurs in establishing the connection to the MySQL database engine, an error message will be displayed and the program will terminate. If the connection to the MySQL database engine is established successfully, then conn will act as a connection handler for the rest of the program.
You will be prompted to enter information for the new ...
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