Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help me fix the error in the code connect _ error ) { die ( Connection failed: . $conn - > connect _

Help me fix the error in the code connect_error){
die("Connection failed: ". $conn->connect_error);
}
// Process registration form data
if ($_SERVER["REQUEST_METHOD"]== "POST"){
// Escape user inputs for security
$fldfullName = $conn->real_escape_string($_POST['fldfullName']);
$fldusername = $conn->real_escape_string($_POST['regfldusername']);
$fldemail = $conn->real_escape_string($_POST['fldemail']);
$fldpassword = $conn->real_escape_string($_POST['regfldpassword']);
$fldgender = $conn->real_escape_string($_POST['fldgender']);
// Insert user data into Users table
$sql = "INSERT INTO Users (fldfullName, fldusername, fldemail, fldpassword, fldfldgender)
VALUES ('$fldfullName', '$fldusername', '$fldemail', '$fldpassword', '$fldgender')";
if ($conn->query($sql)=== TRUE){
echo "New record created successfully";
} else {
echo "Error: ". $sql ."". $conn->error;
}
// Close connection
$conn->close();
}
?>

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

time complexity of a selection sort

Answered: 1 week ago