GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing riverside.github.io — PHP ORM DB__construct()Creates an instance of $db = new DB(); autoCommit(int $value)Disables or enables the default autocommit mode for the current connection. $db->autoCommit(1); begin()Begin a new transaction. $db->begin(); commit()Commits the current transaction, making its changes permanent. $db->commit(); count()Returns a count of the number of non- $db->count(); debug(bool $value)Dumps the information contained by a prepared statement directly on the output. $db->debug(true); delete($modifiers=null)Deletes rows from table, and returns the number of records deleted. Available modifiers are:
$db->delete();
$db->delete('IGNORE');
find($value)Execute the query as a $db->find(1); first()Execute the query as a $db->first(); get()Execute the query as a $db->get(); groupBy(string $value=null)Add a generic $db->groupBy('id');
having(string $value=null)Add a generic $db->having('cnt > 0');
insert(array $data, $modifiers=null)Insert record in the database. Available modifiers are: $db->insert(['name'=>'John']); $db->insert(['name'=>'John'], 'IGNORE'); join(string $table, string $conditions)Add a generic $db->join('roles', 'roles.id=users.role_id');
leftJoin(string $table, string $conditions)Add a generic $db->leftJoin('roles', 'roles.id=users.role_id');
rightJoin(string $table, string $conditions)Add a generic $db->rightJoin('roles', 'roles.id=users.role_id');
limit(int $rowCount=null, int $offset=null)Add a generic $db->limit(10, 20); orderBy(string $value=null)Add a generic $db->orderBy('name ASC');
param(string $key, $value)Binds a value to a corresponding named placeholder in the SQL statement that was used to prepare the statement. $db->param(':q', 'John');
raw(string $value)Returns new DB::raw('NOW()');
releaseSavepoint(string $identifier)Removes the named save point from the set of save points of the current transaction. No commit or rollback occurs. $db->releaseSavepoint('phase-1');
replace(array $data, $modifiers = null)Replace a record in the database. Available modifiers are: $db->replace(['email' => '[email protected]']); $db->replace(['email' => '[email protected]'], 'DELAYED'); reset()Reset all query builder's clauses. $db->reset(); rollback()Rolls back the current transaction, canceling its changes. $db->rollback(); rollbackToSavepoint(string $identifier)Rolls back a transaction to the named save point. $db->rollbackToSavepoint('phase-1');
savepoint(string $identifier)Sets a named transaction save point with a name of identifier. $db->savepoint('phase-1');
select(string $value=null)Add a generic $db->select('users.id, users.name');
table(string $value)Change table name. $db->table('users');
truncate()Empties a table completely. $db->truncate(); update(array $data, $modifiers=null)Update records in the database. Available modifiers are: $db->update(['name'=>'Peter']); $db->update(['name'=>'Peter'], 'IGNORE'); upsert(array $data, $modifiers=null)Insert new records or update the existing ones. Available modifiers are: $db->upsert(['email'=>'[email protected]','name'=>'Peter Schmidt']); $db->upsert(['email'=>'[email protected]','name'=>'Peter Schmidt'], 'LOW_PRIORITY'); value(string $column)Get a single column's value from the first result of a query. $db->value('name');
where()Add a basic where clause to the query. $db->where('(name LIKE :q OR email LIKE :q)');
$db->where('id', 1);
$db->where('id', '=', 1);
$db->where('id', '>', 1);
Expression__construct(string $value)Create an instance of $expr = new Expression('NOW()');
getValue()Returns the value. $expr->getValue(); __toString()Returns the value as string. echo $expr; ExceptionBasethrowException(string $message, int $code=null, \Throwable $previous=null)Throws an exception. $this->throwException('This is an exception');
Configuration__construct(string $username, string $password, string $database, string $host=null, int $port=null, string $driver=null, string $charset=null, string $collation=null)Create an instance of $config = new Configuration('root', 'secret', 'test');
getCharset()Return the charset. echo $config->getCharset(); // 'utf8mb4' getCollation()Return the collation. echo $config->getCollation(); // 'utf8mb4_general_ci' getDatabase()Return the database name. echo $config->getDatabase(); // 'test' getDriver()Return the PDO driver. echo $config->getDriver(); // 'mysql' getHost()Return the host. echo $config->getHost(); // 'localhost' getPassword()Return the password. echo $config->getPassword(); // 'secret' getPort()Return the port. echo $config->getPort(); // 3306 getUsername()Return the username. echo $config->getUsername(); // 'root' Connection__construct(Configuration $configuration)Create an instance of $connection = new Connection($config); getDbh()Return an instance of var_dump($connection->getDbh() instanceof \PDO); // true getDsn()Return the Data Source Name ( echo $connection->getDsn(); // 'mysql:host=localhost;dbname=test' connect()Creates a $connection->connect(); disconnect()Close a previously established connection to the database. $connection->disconnect(); reconnect()Close the current connection and create a new connection. $connection->reconnect(); |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |