Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:core:dbinterface

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

scriptlog:lib:core:dbinterface [2026/09/26 09:09] – admin adminscriptlog:lib:core:dbinterface [2026/09/26 09:16] (current) – admin admin
Line 13: Line 13:
 ======= Docblock Metadata ======= ======= Docblock Metadata =======
  
-  ^ Tag ^ Value ^ +^ Tag ^ Value ^ 
-  | ''@category'' | Core Class | +| ''@category'' | Core Class | 
-  | ''@author'' | M.Noermoehammad | +| ''@author'' | M.Noermoehammad | 
-  | ''@license'' | MIT | +| ''@license'' | MIT | 
-  | ''@version'' | 1.0 | +| ''@version'' | 1.0 | 
-  | ''@since'' | Since Release 1.0 |+| ''@since'' | Since Release 1.0 |
  
 ======= Inheritance ======= ======= Inheritance =======
Line 34: Line 34:
 ======= Methods (12) ======= ======= Methods (12) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''setDbConnection()'' | Set database connection. | 29 | +| public | ''setDbConnection()'' | Set database connection. | 29 | 
-  | public | ''closeDbConnection()'' | Close database connection. | 34 | +| public | ''closeDbConnection()'' | Close database connection. | 34 | 
-  | public | ''dbQuery()'' | Execute an SQL query. | 43 | +| public | ''dbQuery()'' | Execute an SQL query. | 43 | 
-  | public | ''dbInsert()'' | Insert a new record. | 53 | +| public | ''dbInsert()'' | Insert a new record. | 53 | 
-  | public | ''dbReplace()'' | Insert ... On Duplicate Key Update. | 65 | +| public | ''dbReplace()'' | Insert ... On Duplicate Key Update. | 65 | 
-  | public | ''dbUpdate()'' | Update an existing record. | 75 | +| public | ''dbUpdate()'' | Update an existing record. | 75 | 
-  | public | ''dbDelete()'' | Delete a record. | 85 | +| public | ''dbDelete()'' | Delete a record. | 85 | 
-  | public | ''dbLastInsertId()'' | Get the last inserted ID. | 90 | +| public | ''dbLastInsertId()'' | Get the last inserted ID. | 90 | 
-  | public | ''dbTransaction()'' | Start a transaction. | 95 | +| public | ''dbTransaction()'' | Start a transaction. | 95 | 
-  | public | ''dbCommit()'' | Commit the current transaction. | 100 | +| public | ''dbCommit()'' | Commit the current transaction. | 100 | 
-  | public | ''dbRollBack()'' | Rollback the current transaction. | 105 | +| public | ''dbRollBack()'' | Rollback the current transaction. | 105 | 
-  | public | ''isConnected()'' | Check if a database connection is active. | 110 |+| public | ''isConnected()'' | Check if a database connection is active. | 110 |
  
  
Line 59: Line 59:
 Set database connection. Set database connection.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$config'' | ''array'' | //required// | //none// | +|  ''$config'' |  ''array'' |  //required// |  //none// | 
-  | ''$options'' | ''array'' | ''[]'' | //none// |+|  ''$options'' |  ''array'' |  ''[]'' |  //none// |
  
 **Returns:** ''void'' — void **Returns:** ''void'' — void
Line 91: Line 91:
 Execute an SQL query. Execute an SQL query.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$sql'' | ''string'' | //required// | //none// | +|  ''$sql'' |  ''string'' |  //required// |  //none// | 
-  | ''$parameters'' | ''array'' | ''[]'' | //none// |+|  ''$parameters'' |  ''array'' |  ''[]'' |  //none// |
  
 **Returns:** ''(none declared)'' — \PDOStatement|false **Returns:** ''(none declared)'' — \PDOStatement|false
Line 108: Line 108:
 Insert a new record. Insert a new record.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$tablename'' | ''string'' | //required// | //none// | +|  ''$tablename'' |  ''string'' |  //required// |  //none// | 
-  | ''$params'' | ''array'' | //required// | //none// |+|  ''$params'' |  ''array'' |  //required// |  //none// |
  
 **Returns:** ''bool'' — boolean **Returns:** ''bool'' — boolean
Line 127: Line 127:
 Replace statement to Insert or Update row. The correct way to do REPLACE INTO Replace statement to Insert or Update row. The correct way to do REPLACE INTO
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$tablename'' | ''string'' | //required// | //none// | +|  ''$tablename'' |  ''string'' |  //required// |  //none// | 
-  | ''$params'' | ''array'' | //required// | //none// | +|  ''$params'' |  ''array'' |  //required// |  //none// | 
-  | ''$updateParams'' | ''array'' | //required// | //none// |+|  ''$updateParams'' |  ''array'' |  //required// |  //none// |
  
 **Returns:** ''bool'' — boolean **Returns:** ''bool'' — boolean
Line 145: Line 145:
 Update an existing record. Update an existing record.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$tablename'' | ''string'' | //required// | //none// | +|  ''$tablename'' |  ''string'' |  //required// |  //none// | 
-  | ''$params'' | ''array'' | //required// | //none// | +|  ''$params'' |  ''array'' |  //required// |  //none// | 
-  | ''$where'' | ''array'' | //required// | //none// |+|  ''$where'' |  ''array'' |  //required// |  //none// |
  
 **Returns:** ''int'' — int **Returns:** ''int'' — int
Line 163: Line 163:
 Delete a record. Delete a record.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$tablename'' | ''string'' | //required// | //none// | +|  ''$tablename'' |  ''string'' |  //required// |  //none// | 
-  | ''$where'' | ''array'' | //required// | //none// | +|  ''$where'' |  ''array'' |  //required// |  //none// | 
-  | ''$limit'' | ''?int'' | ''null'' | default null |+|  ''$limit'' |  ''?int'' |  ''null'' |  default null |
  
 **Returns:** ''int'' — int **Returns:** ''int'' — int
scriptlog/lib/core/dbinterface.1790413761.txt.gz · Last modified: by admin