enhance new PDO Database class; converted admin_cronjobs

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-10-29 09:02:49 +01:00
parent 87867edfca
commit 5d8906f1d8
2 changed files with 23 additions and 9 deletions

View File

@@ -53,6 +53,15 @@ class Database {
}
}
/**
* returns the number of found rows of the last select query
*
* @return int
*/
public static function num_rows($stmt) {
return Database::query("SELECT FOUND_ROWS()")->fetchColumn();
}
/**
* let's us interact with the PDO-Object by using static
* call like "Database::function()"
@@ -165,7 +174,7 @@ class Database {
* log to a file, so we can actually ask people for the error
* (no one seems to find the stuff in the syslog)
*/
$sl_dir = makeCorrectDir(dirname(dirname(dirname(dirname(__FILE__))))."/logs/");
$sl_dir = makeCorrectDir(FROXLOR_INSTALL_DIR."/logs/");
if (!file_exists($sl_dir)) {
@mkdir($sl_dir, 0755);
}