title: Mysqli Query Echo result
body: <p>Hi I am trying to make status of user so it will check how many post this user has and echo out the result, it was working fine when I was using mysql but after converting it to mysqli it giving me some errors</p>
  
  <p><strong>Here is my code:</strong></p>
  
  <pre><code>&lt;?php
      if(!isset($_COOKIE['loggedin'])){
          header("location:index.php");
      }
  
  session_start();
  
  if(!isset($_SESSION['user'])){
  
  header("location: index.php");
  }
  else {
  
  ?&gt;
  
  &lt;?php 
  $con=mysqli_connect("localhost","root","123","user");
  // Check connection
  if (mysqli_connect_errno())
    {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
  
  $resule = "SELECT count(ID) from save_data where username = '".$_SESSION['user']."'"
      or die(mysql_error()); 
  
  $result = $con-&gt;query($resule);
  
  $row = $result-&gt;fetch_array(MYSQLI_NUM);
  echo $row[0], $row[1];
  
  ?&gt;
  
  &lt;?php }?&gt;
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>Notice: Undefined offset: 1 in C:\xampp\htdocs\mysql_login\status.php on line 30
  </code></pre>