so im trying to make a simple login and register form but when i try logging in, the query to document that i logged in died because i got this:
Query died: insert
so heres my code
if($num2 > 0) //password matches
{
$_SESSION['auth']="yes";
$_SESSION['logname'] = $_POST['fusername'];
$sql = "INSERT INTO login (username,logintime)
VALUES ('$_SESSION[logname]',NOW())";
$result = mysqli_query($cxn,$sql)
or die("Query died: insert");
header("Location: home.php");
thanks =)
the single quotes for logname sends me an error so, thats a wrong syntax
and if i put mysql_error() there it just returns me a blank page
Query died: insert
so heres my code
if($num2 > 0) //password matches
{
$_SESSION['auth']="yes";
$_SESSION['logname'] = $_POST['fusername'];
$sql = "INSERT INTO login (username,logintime)
VALUES ('$_SESSION[logname]',NOW())";
$result = mysqli_query($cxn,$sql)
or die("Query died: insert");
header("Location: home.php");
thanks =)
the single quotes for logname sends me an error so, thats a wrong syntax
and if i put mysql_error() there it just returns me a blank page