Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions