title: Trying to get property of non-object in PHP (mysql)
body: <p>I know that <em>mysql_</em> functions are deprecated, but this is what I'm using right now because I will be using Highcharts. </p>
  
  <p>Aside from that, my problem is here in this code LINE 12 (i.e. the <code>if else</code> conditional):</p>
  
  <pre><code>&lt;?php
      include ('db/database_configuration.php');
      if (isset($_POST['submit'])) 
  {           
      $UserName = $_POST['username'];         
      $UserPassword = $_POST['password']; 
      $result = @mysql_query("SELECT `tblusers`.`username`, `tblusers`.`password` FROM tblusers
              WHERE ((`tblusers`.`username` = '$UserName') AND (`tblusers`.`password` = '$UserPassword'))");
  
  
                  if ($result-&gt;num_rows &gt; 0) {
                      while($row = $result-&gt;fetch_assoc()) {
                        $as = $row['account_stat'];
                  if ($as == "Administrator") {
                  setcookie(loggedin, date("F jS - g:i a"), $seconds);
                  session_start();
                  $_SESSION['username'] = $myuser;
                  header("location:administrator.php?user=$myuser");
                  } else {
                  setcookie(loggedin, date("F jS - g:i a"), $seconds);
                  session_start();
                  $_SESSION['username'] = $myuser;
                  header("location:standard_user.php?user=$myuser");
                  }
                      }
                  } else {
                      print '
                    &lt;div class="w3-panel w3-red"&gt;
                      &lt;h3&gt;Error!&lt;/h3&gt;
                      &lt;p&gt;Account not found.&lt;/p&gt;
                    &lt;/div&gt; 
                  ';
                  }
          }
  ?&gt;
  </code></pre>
  
  <p>This <code>If else</code> conditional utilizes a <em>mysqli_</em> function, but I decided to go back to a <em>mysql_</em> function because the code also uses highcharts. 
  Could anyone help me to convert this <code>If else</code> conditional to using a <em>mysqli_</em> function? Thanks in advance.</p>