[Vtigercrm-commits] [vtiger-commits] r9153 - /vtigercrm/trunk/include/RelatedListView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Aug 28 14:55:47 EDT 2006


Author: richie
Date: Mon Aug 28 12:55:40 2006
New Revision: 9153

Log:
Support for PostGres DB done

Modified:
    vtigercrm/trunk/include/RelatedListView.php

Modified: vtigercrm/trunk/include/RelatedListView.php
==============================================================================
--- vtigercrm/trunk/include/RelatedListView.php (original)
+++ vtigercrm/trunk/include/RelatedListView.php Mon Aug 28 12:55:40 2006
@@ -148,7 +148,7 @@
 	}
 	
 	//Retreiving the no of rows
-	$count_query = "select count(*) count ".substr($query, stripos($query,'from'),strlen($query));
+	$count_query = "select count(*) as count ".substr($query, stripos($query,'from'),strlen($query));
 	$count_result = $adb->query(substr($count_query, stripos($count_query,'select'),stripos($count_query,'ORDER BY')));
 	$noofrows = $adb->query_result($count_result,0,"count");
 	
@@ -174,7 +174,10 @@
 	else
 		$limit_start_rec = $start_rec -1;
 
-	$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page);
+	if( $adb->dbType == "pgsql")
+ 	    $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page);
+ 	else
+ 	    $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page);	
 
 	//Retreive the List View Table Header
 	if($noofrows == 0)





More information about the vtigercrm-commits mailing list