Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

151
 
368
 
368
 
mysql.php
_> 11 <?php
  22 /*
<> 3 -  $Id: mysql.php 151 2005-08-02 14:33:25Z mattice $
   3+  $Id: mysql.php 368 2005-12-22 16:27:23Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
     
 !
1919   class osC_Database_mysql extends osC_Database {
  2020     var $sql_parse_string = 'addslashes',
  2121         $sql_parse_string_with_connection_handler = false,
<> 22 -        $use_transactions = false;
   22+        $use_transactions = false,
   23+        $use_fulltext = false,
   24+        $use_fulltext_boolean = false;
2325 
  2426     function osC_Database_mysql($server, $username, $password) {
  2527       $this->server = $server;
     
 !
125127         }
  126128 
  127129         if ($resource !== false) {
<>  130+          $this->error = false;
   131+          $this->error_number = null;
   132+          $this->error_query = null;
   133+
128134           return $resource;
  129135         } else {
<> 130 -          $this->setError(mysql_error($this->link), mysql_errno($this->link));
   136+          $this->setError(mysql_error($this->link), mysql_errno($this->link), $query);
131137 
  132138           return false;
  133139         }
     
 !
222228       return $sql_query . ' limit ' . $from . ', ' . $maximum_rows;
  223229     }
  224230 
<> 225 -    function batchSize($sql_query, $select_field = '*') {
   231+    function getBatchSize($sql_query, $select_field = '*') {
226232       if (strpos($sql_query, 'SQL_CALC_FOUND_ROWS') !== false) {
  227233         $bb = $this->query('select found_rows() as total');
  228234       } else {
     
 !
254260 
  255261       return $bb->value('total');
  256262     }
<>  263+
   264+    function prepareSearch($columns) {
   265+      if ($this->use_fulltext === true) {
   266+        return 'match (' . implode(', ', $columns) . ') against (:keywords' . (($this->use_fulltext_boolean === true) ? ' in boolean mode' : '') . ')';
   267+      } else {
   268+        $search_sql = '(';
   269+
   270+        foreach ($columns as $column) {
   271+          $search_sql .= $column . ' like :keyword or ';
   272+        }
   273+
   274+        $search_sql = substr($search_sql, 0, -4) . ')';
   275+
   276+        return $search_sql;
   277+      }
   278+    }
<_ 257279   }
  258280 ?>