I'm using phpmyadmin and MySql for a project. This is the php file for the signup page.
<?php
include 'dbh.php';
$username = $_POST['username'];
$email = $_POST['email'];
$pass = $_POST['pass'];
$inst_id = $_POST['inst_id'];
$sql = "INSERT INTO register ( 'username', 'email', 'pass', 'inst_name' ) VALUES('$username','$email','$pass','$inst_id')";
$result = mysqli_query($conn,$sql);
header("Location: index.html");
?>
I am not getting any error, but the data is not getting inserted into the table. When I try entering the data manually into the table and then loging in, it works. This is the code for the login page
<?php
include 'dbh.php';
$email= $_POST['email'];
$pass = $_POST['pass'];
$sql = "SELECT * FROM register WHERE email='$email' AND pass='$pass'";
$result = mysqli_query($conn,$sql);
if (!$row = mysqli_fetch_assoc($result)){
echo "INCORRECT!";
}
else{
//$session_id['id']=$row['id'];
echo "YAYYY";
}
//header("Location: index.html");
Please help! Thanks in advance!!