Select
Create an object to run select queries Sintaxe namespace ProtocolLive\PhpLiveDb; public function PhpLiveDb::Select(
string|UnitEnum
$Table
bool
$ThrowError
=
true
):Select;
Parameters
$Table - The table to perform the select. The table alias can be specified $ThrowError - Throw an error if an validating error occurs Return Values
An object to add options and run the select. Examples
Normal table name
$consult
=
$Db->Select('users');
Table name with alias
//select * from users
$consult
=
$Db->Select('users u');
Using enum
//select * from users u
enum
Tables:string{
Subquery as table
case
Users
=
'users';
}$consult = $Db->Select(Tables::Users);
//select * from users
$consult
=
$Db->Select(
'(select * from users where user_act=1) as users'
);
//select * from (select * from users where user_act=1) as users
|