| [ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 <?php 2 /********************************************************************************* 3 * The contents of this file are subject to the SugarCRM Public License Version 1.1.2 4 * ("License"); You may not use this file except in compliance with the 5 * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL 6 * Software distributed under the License is distributed on an "AS IS" basis, 7 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for 8 * the specific language governing rights and limitations under the License. 9 * The Original Code is: SugarCRM Open Source 10 * The Initial Developer of the Original Code is SugarCRM, Inc. 11 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.; 12 * All Rights Reserved. 13 * Contributor(s): ______________________________________. 14 ********************************************************************************/ 15 16 //Make a count query 17 function mkCountQuery($query) 18 { 19 //Strip of the current SELECT fields and replace them by "select count(*) as count" 20 $query = "SELECT count(*) AS count ".substr($query, strpos($query,'FROM'),strlen($query)); 21 22 //Strip of any "GROUP BY" clause 23 if( strpos($query,'GROUP') > 0) 24 $query = substr($query, 0, strpos($query,'GROUP')); 25 26 //Strip of any "ORDER BY" clause 27 if( strpos($query,'ORDER') > 0) 28 $query = substr($query, 0, strpos($query,'ORDER')); 29 30 //That's it 31 return( $query); 32 } 33 34 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |