title: User Online Remains 1
body: <p>Everything is working and communicating with the database but regardless of how many users are online it stays 1</p>
  
  <p>I have helper functions I created for num rows and query</p>
  
  <blockquote>
    <p>Online Users</p>
  </blockquote>
  
  <pre><code>function users_online(){
  
  
      $session = session_id();
      $time = time();
      $time_out_in_seconds = 60;
      $time_out = $time = $time_out_in_seconds;
  
      $sql = "SELECT * FROM users_online WHERE session = '$session'";
      $result = query($sql);
      $count = row_count($result);
  
      if ($count == NULL) {
  
          $sql= "INSERT INTO users_online(session, time) VALUES ('$session','$time')";
          query($sql);
      } else {
  
          $sql= "UPDATE users_online SET time = '$time' WHERE session = '$session'";
          query($sql);
      }
  
      $sql = "SELECT * FROM users_online WHERE time &gt; '$time_out'";    
      return $count_user = row_count($result);
  }
  </code></pre>
  
  <blockquote>
    <p>DB Config Helper functions</p>
  </blockquote>
  
  <pre><code>$connection = mysqli_connect('localhost', 'root', '', 'danger_db');
  
  function row_count($result)
  {
      return mysqli_num_rows($result);
  }
  
  function escape($string)
  {
      global $connection;
      return mysqli_real_escape_string($connection, $string);
  }
  
  function query($query)
  {
      global $connection;
      return mysqli_query($connection, $query);
  }
  
  function confim($result)
  {
      global $connection;
      if (! $result) {
          die("QUERY FAILED" . mysqli_error($connection));
      }
  }
  
  function fetch_array($result)
  {
      global $connection;
      return mysqli_fetch_array($result);
  }
  </code></pre>
  
  <blockquote>
    <p>Database Table</p>
  </blockquote>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `users_online` (
    `id` int(11) NOT NULL,
    `session` varchar(255) NOT NULL,
    `time` int(11) NOT NULL
  ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=31 ;
  
  --
  -- Dumping data for table `users_online`
  --
  
  INSERT INTO `users_online` (`id`, `session`, `time`) VALUES
  (30, 'n3kppn4lp0n9h4gdm7a6rh84b2', 1452969896),
  (29, 'mqhrkr2b3f2rga1vhqh4t6pe23', 1452969689),
  (28, 'dpg2nmsrvsvottj9k7ot1gvcm6', 1452969893);
  </code></pre>