Download the PHP package flostone/mysql without Composer

On this page you can find all versions of the php package flostone/mysql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mysql

MySQL helper for any PHP Project

Installation

require flostone/mysql-plainphp

Usage

Include the class using
use FloStone\MySQL\MySQL;
Connect to the database using
$sql = MySQL::connect(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
Now execute queries with the query function
$results = $sql->query("SELECT * FROM projects");
The results will always be returned immediately however you can also get the results using
$results = $sql->results();

Using Statements

If you want to make it a little easier you can also use several statements as functions.
E.g. if you wanted to make a where clause you could also write
$projects = $sql->select('*')->where('id', '=', 1)->get();
In order to use these statements you first have to specify a table:
$sql->table('projects');
The table name will stay the same for every query until you eventually change it.
You can also chain the table with several statements:
$projects = $sql->table('projects')->select('*')->where('name', 'like', '%Test%')->orWhere('title', '=', 'Testingproject')->get();
Generally it works as the Laravel Eloquent Builder, which it is based on.

Available Statements

public function insert(array $columns, array $values);
public function create($table, $closure)
public function update($id, array $columns, array $values);
public function drop($table);
public function table($table);
public function select($select = '*');
public function where($column, $operator, $value = NULL);
public function orWhere($column, $operator, $value = NULL);
public function whereIn($column, array $values);
public function join($table, $primary, $operator, $other = NULL);
public function leftJoin($table, $primary, $operator, $other = NULL);
public function rightJoin($table, $primary, $operator, $other = NULL);
public function outerJoin($table, $primary, $operator, $other = NULL);
public function fullOuterJoin($table, $primary, $operator, $other = NULL);
public function orderBy($column, $order = 'desc');
public function all()
public function raw($sql);
public function columnExists($column);
In some cases the operator may also be the value, in that case the operator will be set to '=' by default.

Create function closure

When you want to use the "create" function, you need to pass in a closure or anonymous function as second argument.
This function takes one parameter:
function($table){}
The table parameter is a "Blueprint" instance, which is used to define certain fields in you table.
A basic example of a create query could look like this:
$sql->create('projects', function(Blueprint $table){ $table->increments(); $table->string('name'); $table->timestamps(); });

Blueprint functions

public function increments($name = 'id');
public function string($name, $null = false, $length = 255);
public function integer($name, $null = false, $unsigned = false);
public function text($name, $null = false);
public function custom($customquery);
public function timestamps();
A custom query must be implemented as one column definition:
tinyint(1) DEFAULT 0 NOT NULL


All versions of mysql with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package flostone/mysql contains the following files

Loading the files please wait ....