->let()
Assigns a value as a parameter for this connection.
Method Syntax
$db->let($name, $value)
Arguments
| Arguments | Type | Description |
|---|
name required | string | Specifies the name of the variable. |
value required | mixed | Assigns the value to the variable name. |
Example Usage
$db->let('name', [
"first" => "Tobie",
"last" => "Morgan Hitchcock",
]);
$db->query('CREATE person SET name = $name');
$db->query('SELECT * FROM person WHERE name.first = $name.first');
You can remove the variable from the connection using the unset() method.