I am trying to create a register using php and phpmyadmin. I have got the post working and inserting the data into the table works too. What does work is this line ..
$result = mysqli_query($conn, $sql);
I have tried to debug it using the following code but no errors come up. This is my register.php file.
require_once('config1.php');
if(!$conn):
die('Connect Error (' . mysqli_connect_errno() . ') '.
mysqli_connect_error());
endif;
if(isset($_POST) && !empty($_POST)) {
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$sql = "INSERT INTO 'zz_login' (username, email, password) VALUES ('$username', '$email', '$password')";
$result = mysqli_query($conn, $sql);
if($result) {
echo "user registration successful";
} else {
mysqli_error($conn);
}
}
;
This is my config file
error_reporting(E_ALL);
ini_set('display_errors', '1');
$conn = mysqli_connect("localhost", "username", "password", "database");
if (!$conn) {
die("could not connect" . mysqli_connect_error($conn));
}
Not sure what is wrong, would really appreciate some help. Thanks in advance.