How to do it…

  1. Initialize a MYSQL object:
mysql_init(NULL);
  1. 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);  }
  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);
  1. Create an SQL SELECT statement that will search the row from the users table that ...

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.