[Fusionforge-commits] r8066 - trunk/gforge/www/activity

Roland Mas lolando at libremir.placard.fr.eu.org
Mon Aug 31 18:36:09 CEST 2009


Author: lolando
Date: 2009-08-31 18:36:08 +0200 (Mon, 31 Aug 2009)
New Revision: 8066

Modified:
   trunk/gforge/www/activity/index.php
Log:
Ongoing migration to db_query_params()

Modified: trunk/gforge/www/activity/index.php
===================================================================
--- trunk/gforge/www/activity/index.php	2009-08-31 16:35:56 UTC (rev 8065)
+++ trunk/gforge/www/activity/index.php	2009-08-31 16:36:08 UTC (rev 8066)
@@ -105,10 +105,13 @@
 	$section=$show;
 }
 
-$sql="SELECT * FROM activity_vw WHERE activity_date BETWEEN '".$begin."' AND '".$end."'
-	AND group_id='$group_id' AND section IN ('".implode("','",$section)."') ORDER BY activity_date DESC";
-//echo $sql;
-$res=db_query($sql);
+
+$res=db_query_params ('SELECT * FROM activity_vw WHERE activity_date BETWEEN $1 AND $2
+	AND group_id=$3 AND section = ANY ($4) ORDER BY activity_date DESC',
+		      array($begin,
+			    $end,
+			    $group_id,
+			    db_string_array_to_any_clause ($section)));
 echo db_error();
 
 $results = array();
@@ -177,10 +180,13 @@
 <br />
 	<?php
 
-	$sql="SELECT * FROM activity_vw WHERE activity_date BETWEEN '".$begin."' AND '".$end."'
-	AND group_id='$group_id' AND section IN ('".implode("','",$show)."') ORDER BY activity_date DESC";
-	//echo $sql;
-	$res=db_query($sql);
+
+	$res=db_query_params ('SELECT * FROM activity_vw WHERE activity_date BETWEEN $1 AND $2
+	AND group_id=$3 AND section = ANY ($4) ORDER BY activity_date DESC',
+			      array($begin,
+				    $end,
+				    $group_id,
+				    db_string_array_to_any_clause ($show)));
 	echo db_error();
 
 	$rows=db_numrows($res);




More information about the Fusionforge-commits mailing list