Question: Question 4 You are going to develop a PHP webpage to insert customers email address to the server. Give the MySQL server specification: Database hostname

Question 4

You are going to develop a PHP webpage to insert customers email address to the server.

Give the MySQL server specification:

Database hostname is 192.168.42.160

Username is dbroot

Password is dbroot_pwd

Database name is customerdb

Table name is emailtbl

Complete the follwing PHP code.

// create short variable names $email=$_POST['email']; Blank 1 $db = new Blank 2 ('Blank 3', 'dbroot', 'dbroot_pwd', 'Blank 4');

if (mysqli_connect_errno()) { echo "Error: Could not connect to database. Please try again later."; Blank 5; }

$query = "Blank 6 Blank 7 Blank 8 values ('".$email."')"; $Blank 9 = $db->Blank 10 ($query); if ($result) { echo $db->affected_rows." email inserted into database."; } else { echo "An error has occurred. The item was not added."; }

$db->close(); ?>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!