- Initialize a MYSQL object:
mysql_init(NULL);
- Establish a connection to the MySQL server running at the specified host. Also, generate a connection handler. If any error occurs in establishing a connection to the MySQL server engine, the program will terminate:
if (!mysql_real_connect(conn, server, user, password, database, 0, NULL, 0)) { fprintf(stderr, "%s\n", mysql_error(conn)); exit(1); }
- If the connection to the MySQL database engine is established successfully, you will be prompted to enter the email address of the user whose record you want to delete:
printf("Enter email address of the user to delete: "); scanf("%s", emailaddress);
- Create an SQL SELECT statement that will search the row from the users table that ...