[Fusionforge-commits] r7875 - trunk/gforge/www/stats

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Jun 19 14:59:52 CEST 2009


Author: lolando
Date: 2009-06-19 14:59:52 +0200 (Fri, 19 Jun 2009)
New Revision: 7875

Modified:
   trunk/gforge/www/stats/site_stats_utils.php
Log:
Semi-automated db_query_params() transition for simple cases

Modified: trunk/gforge/www/stats/site_stats_utils.php
===================================================================
--- trunk/gforge/www/stats/site_stats_utils.php	2009-06-19 12:59:40 UTC (rev 7874)
+++ trunk/gforge/www/stats/site_stats_utils.php	2009-06-19 12:59:52 UTC (rev 7875)
@@ -43,10 +43,11 @@
  *	and "special project list" respectively
  */
 function stats_generate_trove_pulldown( $selected_id = 0 ) {
-	$res = db_query("
+	$res = db_query_params ('
 		SELECT trove_cat_id,fullpath
 		FROM trove_cat
-		ORDER BY fullpath");
+		ORDER BY fullpath',
+			array());
 	
 	print '
 		<select name="trovecatid">';
@@ -69,10 +70,11 @@
 
 function stats_trove_cat_to_name( $trovecatid ) {
 
-	$res = db_query("
+	$res = db_query_params ('
 		SELECT fullpath
 		FROM trove_cat
-		WHERE trove_cat_id = '$trovecatid'");
+		WHERE trove_cat_id = $1',
+			array($trovecatid));
 
 	if ( $row = db_fetch_array($res) ) {
 		return $row["fullpath"];
@@ -86,10 +88,11 @@
 	
 	$results = array();
 
-	$res = db_query("
+	$res = db_query_params ('
 		SELECT *
 		FROM trove_group_link
-		WHERE trove_cat_id='$trovecatid'");
+		WHERE trove_cat_id=$1',
+			array($trovecatid));
 
 	print db_error( $res );
 




More information about the Fusionforge-commits mailing list