title: What is wrong here? Sql query give me an error 1146
body: <p>I am trying to use all columns for each row from one table (party), and some columns from another (customer).</p>
  
  <p>Ok, here is my code</p>
  
  <pre><code>public function getParty($data = array()) {
  
      $sql = "SELECT party.* , customer.customer_id AS customerID, customer.firstname AS customerFN, customer.lastname AS customerLN, customer.email AS customerEMAIL, customer.ip AS cutomerIP
      FROM `" . DB_PREFIX . "party` 
      JOIN `" . DB_PREFIX . "cutomer` 
      ON party.cutomer_id = customer.customer_id
      WHERE status=3";
  
      $sort_data = array(
  
  
          'date_added',
          'order_id',
          'customer_id',
          'customerFN',
          'customerLN',
          'customerEMAIL',
          'customerIP',
          'description',
          'status',
          'amount'
  
  
      );
  
      if (isset($data['sort']) &amp;&amp; in_array($data['sort'], $sort_data)) {
          $sql .= " ORDER BY " . $data['sort'];   
      } else {
          $sql .= " ORDER BY date_added"; 
      }
  
      if (isset($data['order']) &amp;&amp; ($data['order'] == 'DESC')) {
          $sql .= " DESC";
      } else {
          $sql .= " ASC";
      }
  
      if (isset($data['start']) || isset($data['limit'])) {
          if ($data['start'] &lt; 0) {
              $data['start'] = 0;
          }           
  
          if ($data['limit'] &lt; 1) {
              $data['limit'] = 20;
          }   
  
          $sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
      }
  
      $query = $this-&gt;db-&gt;query($sql);
  
      return $query-&gt;rows;
  }
  </code></pre>
  
  <p>And here is the error</p>
  
  <pre><code>Notice: Error: Table 'XXX.cutomer' doesn't exist
  Error No: 1146
  SELECT party.* , customer.customer_id AS customerID, customer.firstname AS customerFN, customer.lastname AS customerLN, customer.email AS customerEMAIL, customer.ip AS cutomerIP FROM `party` JOIN `cutomer` ON party.cutomer_id = customer.customer_id WHERE status=3 ORDER BY date_added ASC LIMIT 0,10 in /srv/www/htdocs/XXX/system/database/mysql.php on line 49
  </code></pre>
  
  <p>Maybe I am wrong somewhere, but do not see it</p>
  
  <p>Greetings
  Petar Stoyanov</p>