Database
  • Get started
    • Database for PHP
    • Install / configure
    • Quick reference
  • Dbi
    • Instance model
    • Instance configuration
    • Instance methods
    • Query examples
  • Dba
    • Query builder
    • Put Methods
    • Scope Methods
    • Return Methods
  • SQLI
    • Query execution
    • Request Methods
    • Query Methods
Powered by GitBook
On this page
  • query( $sql )
  • affected_rows()
  • info()
  1. SQLI

Query Methods

PreviousRequest Methods

Last updated 12 months ago

You can query the database using SQL statements using these methods.

query( $sql )

Execute the query. Returns true if the query was successful or reversely false.

$user = $sqli->query('UPDATE users SET email = "hans@nickol.com" WHERE id=3');
Result
true

affected_rows()

Return the number of rows changed with the latest query.

$affected_rows = $sqli->affected_rows();
Result
1

info()

Return info about the latest query.

$info = $sqli->info();
Result
"Rows matched: 1  Changed: 1  Warnings: 0"
query($sql)
affected_rows()
info()