Introduction
Providing necessary functions for using database
メモ
Usually you don't need to use this DB_pdo
class. Try to use Model
class instead.
How to use
You can load DB_pdo
class through Application::getClass
method.
Controller
$database = $this->getClass('DB_pdo');
// Select query
$result = $database->select('table_name')->execute()->all();
Methods
- DB_pdo::select
- Set select query
- DB_pdo::count
- Set select count query
- DB_pdo::insert
- Set insert query
- DB_pdo::update
- Set update query
- DB_pdo::delete
- Set delete query
- DB_pdo::truncate
- Set truncate query
- DB_pdo::createTable
- Set create table query
- DB_pdo::createIndex
- Set create index query
- DB_pdo::alterAddColumn
- Set create alter add column query
- DB_pdo::alterRenameTo
- Set create alter rename to query
- DB_pdo::dropTable
- Set create drop table query
- DB_pdo::dropIndex
- Set create drop index query
- DB_pdo::pragma
- Set pragma query
- DB_pdo::setGroup
- Set group query
- DB_pdo::setItem
- Set query item values
- DB_pdo::setLimit
- Set limit value
- DB_pdo::setOrder
- Set order value
- DB_pdo::setQuery
- Set query string directly
- DB_pdo::setWhere
- Set where condition
- DB_pdo::setHaving
- Set having condition
- DB_pdo::setJoin
- Set join table
- DB_pdo::setOn
- Set on query for joined table
- DB_pdo::disabledRegularUseQuery
- Disable automatic append query flag
- DB_pdo::unsetRegularUseQuery
- Disable automatic append query for a current query flag
- DB_pdo::unsetRegularUseQueryForTable
- Disable automatic append query of the table for a current query flag
- DB_pdo::setInitQueryFlag
- Enable reset query flag
- DB_pdo::unsetInitQueryFlag
- Disable reset query flag
- DB_pdo::execute
- Execute built query
- DB_pdo::compile
- Compile built query (not execute)
- DB_pdo::all
- Get all the result of executed select query
- DB_pdo::one
- Shift the result of executed select query
- DB_pdo::id
- Get the specific column's list of executed select query
- DB_pdo::simpleArray
- Get the specific column's key and value array of executed select query
- DB_pdo::getAffectedRow
- Get affected row number of executed update query
- DB_pdo::getLastIndexId
- Get the last inserted id of executed insert query
- DB_pdo::getLastQuery
- Get the last executed query for debugging
- DB_pdo::getLastQueryDebug
- Get the last executed query and parameter separately for debugging
- DB_pdo::getReturnCode
- Get return code of the last executed query
- DB_pdo::masterServer
- Connect to master server
- DB_pdo::slaveServer
- Connect to slave server