[Fusionforge-commits] r8156 - trunk/gforge/www/scm/reporting

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Sep 23 17:18:56 CEST 2009


Author: lolando
Date: 2009-09-23 17:18:55 +0200 (Wed, 23 Sep 2009)
New Revision: 8156

Modified:
   trunk/gforge/www/scm/reporting/commits_graph.php
   trunk/gforge/www/scm/reporting/commitstime_graph.php
Log:
db_query_params() migration

Modified: trunk/gforge/www/scm/reporting/commits_graph.php
===================================================================
--- trunk/gforge/www/scm/reporting/commits_graph.php	2009-09-23 15:18:47 UTC (rev 8155)
+++ trunk/gforge/www/scm/reporting/commits_graph.php	2009-09-23 15:18:55 UTC (rev 8156)
@@ -70,20 +70,15 @@
 	$end--;
 }
 
-
-
-	$sql="SELECT u.realname,sum(commits) AS count 
+$res = db_query_params ('SELECT u.realname,sum(commits) AS count
 		FROM stats_cvs_user scu, users u
-		WHERE u.user_id=scu.user_id 
-		AND scu.month >= '$formattedmonth'
-		AND group_id='$group_id'
-		GROUP BY realname ORDER BY count DESC";
+		WHERE u.user_id = scu.user_id
+		AND scu.month >= $1
+		AND group_id=$2
+		GROUP BY realname ORDER BY count DESC',
+			array ($formattedmonth,
+			       $group_id));
 
-//echo $sql;
-//exit;
-
-$res=db_query($sql);
-
 if (db_error()) {
 	exit_error('Error',db_error());
 }

Modified: trunk/gforge/www/scm/reporting/commitstime_graph.php
===================================================================
--- trunk/gforge/www/scm/reporting/commitstime_graph.php	2009-09-23 15:18:47 UTC (rev 8155)
+++ trunk/gforge/www/scm/reporting/commitstime_graph.php	2009-09-23 15:18:55 UTC (rev 8156)
@@ -50,11 +50,11 @@
 	exit;
 }
 
-$sql="SELECT month,sum(commits) AS count
+$res = db_query_params ('SELECT month,sum(commits) AS count
 	FROM stats_cvs_group
-	WHERE group_id='$group_id'
-	GROUP BY month ORDER BY month ASC";
-$res=db_query($sql);
+	WHERE group_id=$1
+	GROUP BY month ORDER BY month ASC',
+			array ($group_id));
 echo db_error();
 
 $report->labels=util_result_column_to_array($res,0);




More information about the Fusionforge-commits mailing list