title: Insert value for session user if function returns true?
body: <p><br>
  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. </p>
  
  <p>In PHP should I use a 0 or a 1 for true?</p>
  
  <p>This is the first part of my code that includes the session user and the return of the javascript function.</p>
  
  <pre><code>&lt;?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'];
      }
  }
  ?&gt;
  
  &lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;practice&lt;/title&gt;
  &lt;link rel="stylesheet" type="text/css"  href="Substyle.css"&gt;  
     &lt;script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="js/general.js" type="text/javascript"&gt;
      &lt;/script&gt;   
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form name="myForm" autocomplete="on" onsubmit="return validateForm()"&gt;
  </code></pre>