Hello, I am trying to insert values into a tables from a signup php script. When I run the following part of my code i get -1 echoed to the screen I dont know why so I came here to see if anyone would know.
$query = "INSERT INTO login (ID,FirstName,LastName,StudentID,UserName,Password) VALUES (NULL,?, ?, ?, ?, ?)";
$stmt = mysqli_prepare($con, $query);
mysqli_stmt_bind_param($stmt, "ssiss", $f_Name, $l_Name, $SID, $email, $password);
mysqli_stmt_execute($stmt);
$affected_rows = mysqli_stmt_affected_rows($stmt);
if($affected_rows == 1)
{
require ('regPass.html');
}
else
{
print_r($affected_rows);
require('failedReg.html');
mysqli_close($con);
}