[Vtigercrm-commits] [vtiger-commits] r6170 - /vtigercrm/trunk/modules/Home/UnifiedSearch.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu May 18 18:17:52 EDT 2006
Author: allanbush
Date: Thu May 18 16:17:49 2006
New Revision: 6170
Log:
Cleaned up the SQL which fixes the global search for postgres. Refs #752 and #795.
Modified:
vtigercrm/trunk/modules/Home/UnifiedSearch.php
Modified: vtigercrm/trunk/modules/Home/UnifiedSearch.php
==============================================================================
--- vtigercrm/trunk/modules/Home/UnifiedSearch.php (original)
+++ vtigercrm/trunk/modules/Home/UnifiedSearch.php Thu May 18 16:17:49 2006
@@ -172,7 +172,7 @@
{
global $adb;
- $query = "select * from field where tabid=".getTabid($module);
+ $query = "SELECT * FROM field WHERE tabid = ".getTabid($module);
$result = $adb->query($query);
$noofrows = $adb->num_rows($result);
@@ -186,8 +186,8 @@
if(strstr($listquery,$tablename))
{
if($where != '')
- $where .= ' or ';
- $where .= $tablename.'.'.$columnname.' like "%'.$search_val.'%"';
+ $where .= " OR ";
+ $where .= $tablename.".".$columnname." LIKE ".$adb->quote("%$search_val%");
}
}
@@ -210,7 +210,7 @@
$where = '';
if(count($crmid_array) > 0)
{
- $where = ' crmentity.crmid in (';
+ $where = " crmentity.crmid IN (";
foreach($crmid_array as $index => $crmid)
{
$where .= $crmid.',';
More information about the vtigercrm-commits
mailing list