I want to replace the null in my database with a 1 if my function returns true. I am not sure how to do it when it's for the session user.
In PHP should I use a 0 or a 1 for true?
This is the first part of my code that includes the session user and the return of the javascript function.
<?php
mysql_connect('localhost','user','pass');
mysql_select_db('db');
session_start();
$username=$_SESSION['username'];
if(!$username){
die("Please login");
}
else
{
$query="select *from users WHERE username='$username' ";
$run=mysql_query($query);
while($row=mysql_fetch_array($run)){
$admin=$row['username'];
}
}
?>
<!doctype html>
<html>
<head>
<title>practice</title>
<link rel="stylesheet" type="text/css" href="Substyle.css">
<script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
<script src="js/general.js" type="text/javascript">
</script>
</head>
<body>
<form name="myForm" autocomplete="on" onsubmit="return validateForm()">