From e171f6f34eeacf35cf7142b4788d43e7d0978546 Mon Sep 17 00:00:00 2001 From: canyonknight Date: Wed, 8 Aug 2012 18:09:51 -0400 Subject: Migrate all DB code to use PDO All DB code currently uses the quickly aging mysql_* functions. These functions are strongly discouraged and may eventually be deprecated. Transition all code to utilize the PDO data access abstraction layer. PDO allows for consistent query code across multiple databases. This could potentially allow for someone to use a database other than MySQL with minimal code changes. All functions and behaviors are reproduced as faithfully as possible with PDO equivalents and some changes in code. Signed-off-by: canyonknight Signed-off-by: Lukas Fleischer --- web/lib/cachefuncs.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/lib/cachefuncs.inc.php') diff --git a/web/lib/cachefuncs.inc.php b/web/lib/cachefuncs.inc.php index 3485b01..f109bcf 100644 --- a/web/lib/cachefuncs.inc.php +++ b/web/lib/cachefuncs.inc.php @@ -71,8 +71,8 @@ function db_cache_value($dbq, $dbh, $key, $ttl=600) { $status = false; $value = get_cache_value($key, $status); if (!$status) { - $result = db_query($dbq, $dbh); - $row = mysql_fetch_row($result); + $result = $dbh->query($dbq); + $row = $result->fetch(PDO::FETCH_NUM); $value = $row[0]; set_cache_value($key, $value, $ttl); } -- cgit v1.2.3-70-g09d2