title: open cart extension mysql_query error after updating open cart
body: <p>I have one opencart extension work in old version, as now I update open cart to new version this stop working. Can any one help me how to fix that?</p>
  <pre><code>$table = DB_PREFIX . $table;
              
  $result = mysql_query(&quot;SHOW COLUMNS FROM $table&quot;);
  
  if ($result) {
                      if (mysql_num_rows($result) &gt; 0) {
                          while ($row = mysql_fetch_assoc($result)) {
                              $field_array[] = $row['Field'];
                          }
                      }
                  }
                  if (!in_array($field, $field_array)){
                      $query = 'ALTER TABLE ' . $table . ' ADD ' . $field . ' ' . $def;
                      if ($after != NULL){ $query .= &quot; AFTER &quot; . $after;}
                      $result = $this-&gt;db-&gt;query($query);
                  }
              }
  </code></pre>
  <p>The error I am getting is:</p>
  <blockquote>
  <p>Unknown: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /Applications/XAMPP/xamppfiles/htdocs/opencart/</p>
  <p>Notice: Undefined variable: field_array in /Applications/XAMPP/xamppfiles/htdocs/</p>
  <p>Warning: in_array() expects parameter 2 to be array, null given in /Applications/XAMPP/xamppfiles/htdocs/</p>
  </blockquote>
  <p>I am trying to fix that from last 4 days but can't fix. If I use:</p>
  <pre><code>$result = mysqli_query(&quot;SHOW COLUMNS FROM $table&quot;);
  </code></pre>
  <p>I got error bellow:</p>
  <blockquote>
  <p>Warning: mysqli_query() expects at least 2 parameters, 1 given in /</p>
  </blockquote>
  <p>If I use:</p>
  <pre><code>$result = $this-&gt;db-&gt;query(&quot;SHOW COLUMNS FROM $table&quot;);
  </code></pre>
  <p>I got error:</p>
  <blockquote>
  <p>Warning: mysql_num_rows() expects parameter 1 to be resource, object given in</p>
  </blockquote>