Address:
"; print ""; print ""; print "Phone #:
"; print ""; print ""; print ""; print ""; } elseif (isset ($_POST['delete'])) { // Creating a mysqli object establishes a database connection $db_server = new mysqli($db_hostname, $db_username, $db_password, $db_database); // We can call connect_errno to see If the connection failed- zero means no error occurred if ($db_server->connect_errno) { // connect_error returns the a string of the error from the latest sql command print ("" . $db_server->connect_error . "
"); } else { // We successfully connected to the database // The query is a php string if (isset($_POST['cno'])) { $query = "DELETE FROM customers WHERE cno='". $_POST['cno'] . "';"; $customers_result = $db_server->query($query); if (!$customers_result) { /* If there was an error executing the query, the result will be false, otherwise its a mysql result resource. */ print ("" . $db_server->error . "
"); } else { print "" . $_POST['cname'] . " was successfully deleted!
"; } } } // You should always close server connections when you're done $db_server->close(); if ($db_server->connect_errno) { // connect_error returns the a string of the error from the latest sql command print ("" . $db_server->connect_error . "
"); } } ?>