diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-14 17:45:06 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-14 17:45:06 +0000 |
| commit | 7159120b2509be8b3e3629c283425e307c720fb9 (patch) | |
| tree | e55e14084deb72c1d2a1a3d57843ea219ecde960 /phpBB/includes/db | |
| parent | 90b7ac2dbf14f98605fec7c9e3a4dc71a6b7f816 (diff) | |
| download | forums-7159120b2509be8b3e3629c283425e307c720fb9.tar forums-7159120b2509be8b3e3629c283425e307c720fb9.tar.gz forums-7159120b2509be8b3e3629c283425e307c720fb9.tar.bz2 forums-7159120b2509be8b3e3629c283425e307c720fb9.tar.xz forums-7159120b2509be8b3e3629c283425e307c720fb9.zip | |
- store error result in dbal for later retrieving
- use method for moving modules up/down (will be extended later to not only support an amount of 1)
- utilize the module methods in installation
git-svn-id: file:///svn/phpbb/trunk@6061 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db')
| -rw-r--r-- | phpBB/includes/db/dbal.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index e132cec706..ecfe71f1ef 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -31,7 +31,13 @@ class dbal var $user = ''; var $server = ''; var $dbname = ''; - + + // Set to true if error triggered + var $sql_error_triggered = false; + + // Holding the last sql query on sql error + var $sql_error_sql = ''; + /** * Constructor */ @@ -49,6 +55,9 @@ class dbal */ function sql_return_on_error($fail = false) { + $this->sql_error_triggered = false; + $this->sql_error_sql = ''; + $this->return_on_error = $fail; } @@ -167,6 +176,9 @@ class dbal * * Idea for this from Ikonboard * Possible query values: INSERT, INSERT_SELECT, MULTI_INSERT, UPDATE, SELECT + * + * If a key is 'module_name' and firebird used it gets adjusted to '"module_name"' + * on INSERT, INSERT_SELECT, UPDATE and SELECT */ function sql_build_array($query, $assoc_ary = false) { @@ -175,13 +187,13 @@ class dbal return false; } - $fields = array(); - $values = array(); + $fields = $values = array(); + if ($query == 'INSERT' || $query == 'INSERT_SELECT') { foreach ($assoc_ary as $key => $var) { - $fields[] = $key; + $fields[] = ($key == 'module_name' && SQL_LAYER == 'firebird') ? '"' . $key . '"' : $key; if (is_null($var)) { @@ -235,6 +247,8 @@ class dbal $values = array(); foreach ($assoc_ary as $key => $var) { + $key = ($key == 'module_name' && SQL_LAYER == 'firebird') ? '"' . $key . '"' : $key; + if (is_null($var)) { $values[] = "$key = NULL"; @@ -313,6 +327,10 @@ class dbal { global $auth, $user; + // Set var to retrieve errored status + $this->sql_error_triggered = true; + $this->sql_error_sql = $sql; + $error = $this->_sql_error(); if (!$this->return_on_error) |
