diff options
| author | Mark Newnham <mark@newnhams.com> | 2025-08-11 19:44:26 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-11 19:44:26 -0600 |
| commit | 8f5069444ceb613a1c53829cd2784bed1f731e12 (patch) | |
| tree | 3608e25839b16408acc747186caffb63da41f419 /drivers/adodb-sqlite3.inc.php | |
| parent | 8d4e1b70f325c406269b4e3b3cde884fd0170c74 (diff) | |
| parent | 54bf65e764540ef72b70a5b0e9605f28734c899e (diff) | |
| download | adodb-8f5069444ceb613a1c53829cd2784bed1f731e12.tar.gz adodb-8f5069444ceb613a1c53829cd2784bed1f731e12.tar.bz2 adodb-8f5069444ceb613a1c53829cd2784bed1f731e12.zip | |
Merge pull request #1087 from ADOdb:1086-sqlite-ifnull-method-returns-incorrect-sql
1086-sqlite-ifnull-method-returns-incorrect-sql
Diffstat (limited to 'drivers/adodb-sqlite3.inc.php')
| -rw-r--r-- | drivers/adodb-sqlite3.inc.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/adodb-sqlite3.inc.php b/drivers/adodb-sqlite3.inc.php index 27a1562a..6d25762e 100644 --- a/drivers/adodb-sqlite3.inc.php +++ b/drivers/adodb-sqlite3.inc.php @@ -54,6 +54,18 @@ class ADODB_sqlite3 extends ADOConnection { return $arr; } + /** + * Return string with a database specific IFNULL statement + * + * @param string $field Field name to check for null + * @param string $ifNull Value to return if $field is null + * + * @return string + */ + function IfNull( $field, $ifNull ) { + return " IFNULL($field, $ifNull) "; // if SQLite 3.X + } + function BeginTrans() { if ($this->transOff) { |
