Question: trying to get sql data When two tables are related how to implement foreign key and insert data. This is what I tried. ?php include_once

trying to get sql data When two tables are related how to implement foreign key and insert data. This is what I tried. trying to get sql data When two tables are related how to

?php include_once 'dbh.inc.php'; $first = $_POST['firstname' ); $last = $_POST[ 'lastname']; $phone = $_POST['phone']; $email = $_POST['email']; $address = $_POST[ 'address']; $user = $ POST['username'; $password = $_POST['pw']; $sql = "INSERT INTO person (fname, 1name, phone_no, email, address) VALUES ('$first', '$last', '$phone', '$email', 'Saddress');"; mysqli_query($conn, $sql); $sq12 = "INSERT INTO customer (user name, password) VALUES ('$user', '$password');"; mysqli_query($conn, $sq12)

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!