Question: Modify/add jQuery scripts in form_viz.php, so that the input data is posted to the insert.php file when the submit button is clicked. Then, modify the

Modify/add jQuery scripts in "form_viz.php", so that the input data is posted to the "insert.php" file when the "submit" button is clicked.

Then, modify the "insert.php" file so that the posted data can be inserted in to the "city" table of the "sakila" DB as an entry.

This is the code I have so far for "form_viz.php"

Put a form here

And here is my code for "inset.php"

require "config.php";

// Create connection $conn = mysqli_connect($server, $username, $password, $db);

// Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); }

// A function for general queries. function query_to_db($conn, $sql){ $result = mysqli_query($conn, $sql);

if ($result) { echo "Your query was successful"; } else { echo "Error: " . $sql . " " . mysqli_error($conn); }

}

// Receiving the submitted data

// You need to save the data into the database. Write an INSERT query here. $sql = ""; query_to_db($conn, $sql);

mysqli_close($conn);

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!