Select::FieldsGet

Get all fields of the table

Sintaxe

namespace ProtocolLive\PhpLiveDb;

/**

 */
final class Select{
public function FieldsGet(
string|UnitEnum $Table = null,
FieldsGetReturn $Return = FieldsGetReturn::String,
string $Alias = null
):array|string;
}
Parameters

$Table - Use a different table than the one specified in Select;

$Return - Return type. See FieldsGetReturn for more details;

$Alias - Concatenates the alias with all field names;

See more

- FieldsGetExcept

- FieldsGetReturn

Examples

$consult = $Db->Select('users');
echo $consult->FieldsGet();
//user_id,user,email,pwd,created,lastlogin

$consult = $Db->Select('users');
var_dump($consult->FieldsGet(Return: FieldsGetReturn::Array));
/*
array(6) {
[0] =>
string(7) "user_id",
[1] =>
string(4) "user",
[2] =>
string(5) "email",
[3] =>
string(3) "pwd",
[4] =>
string(7) "created",
[5] =>
string(9) "lastlogin"
}
*/