aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2018-01-29 16:59:05 -0500
committerBrian Evans <grknight@gentoo.org>2018-01-29 16:59:05 -0500
commitd180173111518d7c87538dafdeac6727d6c6e47a (patch)
treec23b6df4a65ac013c7f20fd29736f958bbc76db5
parentBug fixes for some typos (diff)
downloadbouncer-d180173111518d7c87538dafdeac6727d6c6e47a.tar.gz
bouncer-d180173111518d7c87538dafdeac6727d6c6e47a.tar.bz2
bouncer-d180173111518d7c87538dafdeac6727d6c6e47a.zip
More database typo fixes
-rw-r--r--php/lib/db.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/php/lib/db.php b/php/lib/db.php
index 34e49e3..ae20f9e 100644
--- a/php/lib/db.php
+++ b/php/lib/db.php
@@ -43,7 +43,7 @@ public static function query($qry=null, $parameters=[])
else return false;
}
if(!empty($parameters)) {
- static::$result = static::$dbh->prepare($query);
+ static::$result = static::$dbh->prepare($qry);
static::$result->execute($parameters);
}
else {
@@ -149,7 +149,7 @@ public static function close($dbh=null)
* @param int $type result type
*/
public static function get_one($query,$type=PDO::FETCH_ASSOC,$parameters=[]) {
- $buf = static::get($query.' LIMIT 1',$type,$parameters);
+ $buf = static::get($query.' LIMIT 1',$type,null,$parameters);
return $buf[0];
}
@@ -162,7 +162,7 @@ public static function get_one($query,$type=PDO::FETCH_ASSOC,$parameters=[]) {
*/
public static function name_to_id($table,$id_col,$name_col,$name)
{
- $buf = static::get_one("SELECT {$id_col} FROM {$table} WHERE {$name_col} = :name", PDO::FETCH_NUM, [':name' => $name]);
+ $buf = static::get_one("SELECT {$id_col} FROM {$table} WHERE {$name_col} = ?", PDO::FETCH_NUM, [$name]);
return $buf[0];
}