commit: d180173111518d7c87538dafdeac6727d6c6e47a
Author: Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 29 21:59:05 2018 +0000
Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Mon Jan 29 21:59:05 2018 +0000
URL: https://gitweb.gentoo.org/proj/bouncer.git/commit/?id=d1801731
More database typo fixes
php/lib/db.php | 6 +++---
1 file 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];
}