title: PHP Parse error: syntax error, unexpected ',' in
body: <p>Well, basically I am working on a register and login tutorial on youtube. Which is using the old version of PHP, and I have attempted to update the code, however I get this error:</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected ',' in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\Forum\forum\core\functions\users.php on line 23</p>
  </blockquote>
  
  <p>users.php</p>
  
  <pre><code>&lt;?php
  function user_exists($username, $con) {
      $data = $username;
      $username = sanitize($data, $con); 
      $username = $data;
      mysqli_query($con, "SELECT `user_id` FROM `users` WHERE `username` = '$username'");
      return(mysqli_affected_rows($con) == 1) ? true : false;
  }
  
  function user_active($username, $con) {
      $data = $username;
      $username = sanitize($data, $con); 
      $username = $data;
      mysqli_query($con, "SELECT `user_id` FROM `users` WHERE `username` = '$username' AND `active` = 1");
      return(mysqli_affected_rows($con) == 1) ? true : false;
  }
  
  function user_id_from_username ($username, $con) {
      $data = $username;
      $username = sanitize($data, $con); 
      $username = $data;
      mysqli_query($con, "SELECT `user_id` FROM `users` WHERE `username` = '$username'");
      return mysqli_affected_rows($con), 0, 'user_id';
  }
  
  function login($username, $password, $con) {
      $user_id = user_id_from_username($username, $con);
      $data = $username;
      $username = sanitize($data, $con); 
      $username = $data;
      $password = md5($password); 
      return (mysqli_affected_rows(mysqli_query($con, "SELECT `user_id` FROM `users` WHERE `username` = '$username' AND `password` = '$password'"), 0) == 1) ? $user_id : false;
  }
  ?&gt;
  </code></pre>