Revision: 1287
http://mrbs.svn.sourceforge.net/mrbs/?rev=1287&view=rev
Author: cimorrison
Date: 2009-12-17 17:53:52 +0000 (Thu, 17 Dec 2009)
Log Message:
-----------
- Ensured that sql_row_keyed() actually returns an associative array, rather
than one with both numeric and associative indices
- Fixed a couple of places that still relied on a numeric index
Modified Paths:
--------------
mrbs/trunk/web/month.php
mrbs/trunk/web/mysql.inc
mrbs/trunk/web/mysqli.inc
mrbs/trunk/web/pgsql.inc
mrbs/trunk/web/week.php
Modified: mrbs/trunk/web/month.php
===================================================================
--- mrbs/trunk/web/month.php 2009-12-14 20:30:23 UTC (rev 1286)
+++ mrbs/trunk/web/month.php 2009-12-17 17:53:52 UTC (rev 1287)
@@ -153,7 +153,7 @@
echo "<ul>\n";
for ($i = 0; ($row = sql_row_keyed($res, $i)); $i++)
{
- echo "<li><a
href=\"month.php?year=$year&month=$month&day=$day&area=$row[0]\">";
+ echo "<li><a
href=\"month.php?year=$year&month=$month&day=$day&area=${row['id']}\">";
echo "<span" . (($row['id'] == $area) ? ' class="current"' : '') . ">";
echo htmlspecialchars($row['area_name']) . "</span></a></li>\n";
}
Modified: mrbs/trunk/web/mysql.inc
===================================================================
--- mrbs/trunk/web/mysql.inc 2009-12-14 20:30:23 UTC (rev 1286)
+++ mrbs/trunk/web/mysql.inc 2009-12-17 17:53:52 UTC (rev 1287)
@@ -121,7 +121,9 @@
return 0;
}
mysql_data_seek($r, $i);
- return mysql_fetch_array($r);
+ // Use _array() rather _assoc() to ensure support
+ // for as many PHP versions as possible
+ return mysql_fetch_array($r, MYSQL_ASSOC);
}
Modified: mrbs/trunk/web/mysqli.inc
===================================================================
--- mrbs/trunk/web/mysqli.inc 2009-12-14 20:30:23 UTC (rev 1286)
+++ mrbs/trunk/web/mysqli.inc 2009-12-17 17:53:52 UTC (rev 1287)
@@ -128,7 +128,9 @@
return 0;
}
$r->data_seek($i);
- return $r->fetch_array();
+ // Use _assoc rather than _array because _array doesn't have
+ // an ASSOC parameter. No impact on PHP version support.
+ return $r->fetch_assoc();
}
Modified: mrbs/trunk/web/pgsql.inc
===================================================================
--- mrbs/trunk/web/pgsql.inc 2009-12-14 20:30:23 UTC (rev 1286)
+++ mrbs/trunk/web/pgsql.inc 2009-12-17 17:53:52 UTC (rev 1287)
@@ -136,7 +136,9 @@
pg_free_result($r);
return 0;
}
- return pg_fetch_array($r, $i);
+ // Use _array() rather _assoc() to ensure support
+ // for as many PHP versions as possible
+ return pg_fetch_array($r, $i, PGSQL_ASSOC);
}
Modified: mrbs/trunk/web/week.php
===================================================================
--- mrbs/trunk/web/week.php 2009-12-14 20:30:23 UTC (rev 1286)
+++ mrbs/trunk/web/week.php 2009-12-17 17:53:52 UTC (rev 1287)
@@ -146,7 +146,7 @@
echo "<ul>\n";
for ($i = 0; ($row = sql_row_keyed($res, $i)); $i++)
{
- echo "<li><a
href=\"week.php?year=$year&month=$month&day=$day&area=$row[0]\">";
+ echo "<li><a
href=\"week.php?year=$year&month=$month&day=$day&area=${row['id']}\">";
echo "<span" . (($row['id'] == $area) ? ' class="current"' : '') . ">";
echo htmlspecialchars($row['area_name']) . "</span></a></li>\n";
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits