diff options
author | 2018-01-30 10:37:19 -0500 | |
---|---|---|
committer | 2018-01-30 10:37:19 -0500 | |
commit | 2d323e26c63a2f1d11f347a6bb725c095965bda2 (patch) | |
tree | ac8b60dc63ccbe97fd074e4a6a0682912c4721bf | |
parent | Restore lists (diff) | |
download | bouncer-2d323e26c63a2f1d11f347a6bb725c095965bda2.tar.gz bouncer-2d323e26c63a2f1d11f347a6bb725c095965bda2.tar.bz2 bouncer-2d323e26c63a2f1d11f347a6bb725c095965bda2.zip |
fix library comments and convert util query
-rw-r--r-- | php/lib/db.php | 4 | ||||
-rw-r--r-- | php/lib/util.php | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/php/lib/db.php b/php/lib/db.php index ae20f9e..003be70 100644 --- a/php/lib/db.php +++ b/php/lib/db.php @@ -1,6 +1,6 @@ <?php /** - * Minimal wrappers for core PHP mysql_* functions. + * Minimal wrappers for core PHP PDO functions. * @package mirror * @subpackage lib */ @@ -109,7 +109,7 @@ public static function get($query,$type=PDO::FETCH_BOTH,$col_id=NULL,$parameters } /** - * Since PHP's mysql_insert_id() sometimes throws an error, this is the replacement + * Wrapper for PDOStatement::lastInsertId() * @param PDO $dbh optional dbh to get the last inserted id from * @return int the return value of MySQL's last_insert_id() */ diff --git a/php/lib/util.php b/php/lib/util.php index af64fbb..8f8e1e4 100644 --- a/php/lib/util.php +++ b/php/lib/util.php @@ -13,7 +13,7 @@ function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); -} +} /** * Add a message to SESSION['messages'] array. @@ -157,8 +157,8 @@ function emptify_in_array($array, $needle) */ function record_exists($table,$column,$val,$extra=NULL) { - $result = db_query("SELECT * FROM {$table} WHERE {$column}='{$val}' {$extra}"); - if ($result&&mysql_num_rows($result)>0) + $result = DB::query("SELECT * FROM {$table} WHERE {$column}='{$val}' {$extra}"); + if ($result&&$result->rowCount()>0) { return true; } |