diff options
author | zotlabs <mike@macgirvin.com> | 2016-10-12 18:15:12 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-10-12 18:15:12 -0700 |
commit | 9bb847bb07ec017eb8e2ebb2764b7e34acf5e619 (patch) | |
tree | 801e83538f88a96966887a31dd7c10eb951c93e5 /include/dba/dba_driver.php | |
parent | 40bfce463d13a82a30ae590d650b916a051b8d31 (diff) | |
download | volse-hubzilla-9bb847bb07ec017eb8e2ebb2764b7e34acf5e619.tar.gz volse-hubzilla-9bb847bb07ec017eb8e2ebb2764b7e34acf5e619.tar.bz2 volse-hubzilla-9bb847bb07ec017eb8e2ebb2764b7e34acf5e619.zip |
remove the rest of the backticks from sql queries; replace with TQUOT const which is driver dependent
Diffstat (limited to 'include/dba/dba_driver.php')
-rwxr-xr-x | include/dba/dba_driver.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php index 852dc16af..36353354c 100755 --- a/include/dba/dba_driver.php +++ b/include/dba/dba_driver.php @@ -72,6 +72,7 @@ class DBA { define('NULL_DATE', self::$dba->get_null_date()); define('ACTIVE_DBTYPE', self::$dbtype); + define('TQUOT', self::$dba->get_table_quote()); return self::$dba; } @@ -88,6 +89,7 @@ abstract class dba_driver { const INSTALL_SCRIPT='install/schema_mysql.sql'; const NULL_DATE = '0001-01-01 00:00:00'; const UTC_NOW = 'UTC_TIMESTAMP()'; + const TQUOT = "`"; protected $db; protected $pdo = array(); @@ -157,6 +159,11 @@ abstract class dba_driver { return static::INSTALL_SCRIPT; } + function get_table_quote() { + return static::TQUOT; + } + + function utcnow() { return static::UTC_NOW; } @@ -313,7 +320,7 @@ function db_concat($fld, $sep) { * queries return true if the command was successful or false if it wasn't. * * Example: - * $r = q("SELECT * FROM `%s` WHERE `uid` = %d", + * $r = q("SELECT * FROM %s WHERE `uid` = %d", * 'user', 1); * * @param string $sql The SQL query to execute |