PHP code example of fyre / db
1. Go to this page and download the library: Download fyre/db library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fyre / db example snippets
use Fyre\DB\ConnectionManager;
ConnectionManager::clear();
$config = ConnectionManager::getConfig($key);
$config = ConnectionManager::getConfig();
$key = ConnectionManager::getKey($connection);
$hasConfig = ConnectionManager::hasConfig($key);
$isLoaded = ConnectionManager::isLoaded($key);
$connection = ConnectionManager::load($options);
ConnectionManager::setConfig($key, $options);
ConnectionManager::setConfig($config);
$unloaded = ConnectionManager::unload($key);
$connection = ConnectionManager::use($key);
$affectedRows = $connection->affectedRows();
$connection->afterCommit($callback, $priority, $key);
$connection->begin();
$connection->commit();
$connection->connect();
$query = $connection->delete($alias);
$connection->disconnect();
$result = $connection->execute($sql, $params);
$charset = $connection->getCharset();
$error = $connection->getError();
$savePointLevel = $connection->getSavePointLevel();
$inTransaction = $connection->inTransaction();
$query = $connection->insert();
$query = $connection->insertFrom($from, $columns);
$id = $connection->insertId();
$literal = $connection->literal($string);
$result = $connection->query($sql);
$quoted = $connection->quote($value);
$query = $connection->replace();
$connection->rollback();
$query = $connection->select($fields);
$connection->setCharset($charset);
$result = $connection->transactional($callback);
$query = $connection->update($table);
$query = $connection->updateBatch($table);
$version = $connection->version();
ConnectionManager::setConfig($key, $options);
$connection = ConnectionManager::use($key);
$collation = $connection->getCollation();
ConnectionManager::setConfig($key, $options);
$connection = ConnectionManager::use($key);
$connection->setSchema($schema);
ConnectionManager::setConfig($key, $options);
$connection = ConnectionManager::use($key);
$result = $query->execute();
$connection = $query->getConnection();
$table = $query->getTable();
$sql = $query->sql();
$query->table($table, $overwrite);
$connection
->delete($alias)
->from($table)
->where($conditions)
->execute();
$query->alias($alias, $overwrite);
$query->epilog($epilog);
$query->from($table, $overwrite);
$alias = $query->getAlias();
$epilog = $query->getEpilog();
$table = $query->getFrom();
$joins = $query->getJoin();
$limit = $query->getLimit();
$orderBy = $query->getOrderBy();
$table = $query->getUsing();
$conditions = $query->getWhere();
$query->join($joins, $overwrite);
$query->limit($limit);
$query->orderBy($fields, $overwrite);
$query->using($table, $overwrite);
$query->where($conditions, $overwrite);
$connection
->insert()
->into($table)
->values($values)
->execute();
$query->epilog($epilog);
$epilog = $query->getEpilog();
$table = $query->getInto();
$values = $query->getValues();
$query->into($table, $overwrite);
$query->values($values, $overwrite);
$connection
->insertFrom($from, $columns)
->into($table)
->execute();
$query->epilog($epilog);
$epilog = $query->getEpilog();
$table = $query->getInto();
$query->into($table, $overwrite);
$connection
->replace()
->into($table)
->values($values)
->execute();
$query->epilog($epilog);
$epilog = $query->getEpilog();
$table = $query->getInto();
$values = $query->getValues();
$query->into($table, $overwrite);
$query->values($values, $overwrite);
$results = $connection
->select($fields)
->from($table)
->where($conditions)
->execute();
$query->distinct($distinct);
$query->epilog($epilog);
$query->except($union, $overwrite);
$query->from($table, $overwrite);
$distinct = $query->getDistinct();
$epilog = $query->getEpilog();
$groupBy = $query->getGroupBy();
$table = $query->getFrom();
$having = $query->getHaving();
$joins = $query->getJoin();
$limit = $query->getLimit();
$offset = $query->getOffset();
$orderBy = $query->getOrderBy();
$fields = $query->getSelect();
$unions = $query->getUnion();
php
$conditions = $query->getWhere();
php
$with = $query->getWith();
php
$query->groupBy($fields, $overwrite);
php
$query->having($conditions, $overwrite);
php
$query->intersect($union, $overwrite);
php
$query->join($joins, $overwrite);
php
$query->limit($limit, $offset);
php
$query->offset($offset);
php
$query->orderBy($fields, $overwrite);
php
$query->select($fields, $overwrite);
php
$query->union($union, $overwrite);
php
$query->unionAll($union, $overwrite);
php
$query->where($conditions, $overwrite);
php
$query->with($with, $overwrite);
php
$query->withRecursive($with, $overwrite);
php
$connection
->update($table)
->set($data)
->where($conditions)
->execute();
php
$query->epilog($epilog);
php
$query->from($table, $overwrite);
php
$data = $query->getData();
php
$epilog = $query->getEpilog();
php
$table = $query->getFrom();
php
$joins = $query->getJoin();
php
$conditions = $query->getWhere();
php
$query->join($joins, $overwrite);
php
$query->set($data, $overwrite);
php
$query->where($conditions, $overwrite);
php
$connection
->updateBatch($table)
->set($data, $keys)
->execute();
php
$query->epilog($epilog);
php
$data = $query->getData();
php
$epilog = $query->getEpilog();
php
$query->set($data, $keys, $overwrite);
php
foreach ($result AS $row) { }
php
$array = $result->all();
php
$result->clearBuffer($index);
php
$result->clearBuffer();
php
$columnCount = $result->columnCount();
php
$columns = $result->columns();
php
$count = $result->count();
php
$row = $result->fetch($index);
php
$first = $result->first();
php
$result->free();
php
$parser = $result->getType($name);
php
$last = $result->last();