SPHPlayground API
SPHPlayground
sphplayground sphplayground

Inserting records

An SQL INSERT statement adds one or more records to any single table in a relational database.[1] One can insert one or more rows specified by value expressions, or zero or more rows resulting from a query. [2]

The Insert interface defines declarative SQL INSERT statement for the framework.

Synopsis
interface Insert implements Query
Sets the database table where to insert the data
public into(string $table):static
Sets the values that are to be inserted to the table
public values(mixed ... $values):static
Sets the values that are to be inserted to the table
public valuesFromArray(array $values):static
Sets the order and the names of the columns in the INSERT data
public columnNames(string ... $name):static
Returns the parameter handler
public getParams():ParameterHandler
Prepares a statement for execution and returns a statement object
public createStatement(PDO $pdo):Statement
Returns the generated SQL language string
public __toString():string
Checks the basic validity of the SQL language generated
public isValid():bool