title: ILLEGAL & UNINITIALIZED string offset error
body: <p>I'm having trouble fixing my errors, the functions are working fine but i need to get rid of the errors</p>
  <p>i have this following errors:</p>
  <blockquote>
  <p>Warning: Illegal string offset 'userID' in C:\xampp\htdocs\checkout.php on line 15</p>
  <p>Notice: Uninitialized string offset: 0 in C:\xampp\htdocs\checkout.php on line 15</p>
  <p>Fatal error: Call to a member function fetch_assoc() on boolean in C:\xampp\htdocs\checkout.php on line 19</p>
  </blockquote>
  <p>and heres my code:</p>
  <p>CHECKOUT.PHP</p>
  <pre><code>&lt;?php
  // include database configuration file
  include 'dbConfig.php';
  include 'login.php';
  // initializ shopping cart class
  include 'Cart.php';
  $cart = new Cart;
  
  // redirect to home if cart is empty
  if($cart-&gt;total_items() &lt;= 0){
  header(&quot;Location: index.php&quot;);
  }
  
  // set customer ID in session
  $_SESSION['sessCustomerID'] = $sessData['userID']; //this is the ID for the logged in user
  
  // get customer details by session customer ID
  $query = $db-&gt;query(&quot;SELECT * FROM users WHERE id =&quot;.$_SESSION['sessCustomerID']);
  $custRow = $query-&gt;fetch_assoc(); 
  ?&gt;
  </code></pre>
  <p>LOGIN.PHP</p>
  <pre><code>&lt;?php
   session_start();
  $sessData = !empty($_SESSION['sessData'])?$_SESSION['sessData']:'';
  if(!empty($sessData['status']['msg'])){
      $statusMsg = $sessData['status']['msg'];
      $statusMsgType = $sessData['status']['type'];
      unset($_SESSION['sessData']['status']);
  }
  ?&gt;
  &lt;div class=&quot;container&quot;&gt;
      &lt;?php
          if(!empty($sessData['userLoggedIn']) &amp;&amp; !empty($sessData['userID'])){
          include 'user.php';
          $user = new User();
          $conditions['where'] = array(
              'id' =&gt; $sessData['userID'],
          );
          $conditions['return_type'] = 'single';
          $userData = $user-&gt;getRows($conditions);
  ?&gt;
  </code></pre>
  <p>DBCONFIG.PHP</p>
  <pre><code>&lt;?php
  //DB details
  $dbHost = 'localhost';
  $dbUsername = 'root';
  $dbPassword = '';
  $dbName = 'dbblair';
  
  //Create connection and select DB
  $db = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName);
  
  if ($db-&gt;connect_error) {
      die(&quot;Unable to connect database: &quot; . $db-&gt;connect_error);
  } 
  ?&gt;
  </code></pre>