Update::Run

Execute the query

Sintaxe


namespace ProtocolLive\PhpLiveDb;

function Update::Run(
bool $Debug = false,
bool $HtmlSafe = true,
bool $TrimValues = true,
bool $Log = false,
int|BackedEnum $LogEvent = null,
int $LogUser = null
):int;
Parameters

$Debug - Dumps in screen the query sended to server. Do not work if a error occurs in the preparation phase;

$HtmlSafe - If HTML tag will be escaped;

$TrimValues - If spaces in the begin and end of the values need to be removed;

$Log - If the query will be logged in the logs table. The table structure are in sql folder;

$LogEvent - An integer to represent the event to be logged;

$LogUser - The user ID to be logged;

Return

Return the number of rows affected by the query

Examples

$Db->Update('users')
->FieldAdd(
'pwd',
password_hash($_POST['email'], PASSWORD_DEFAULT),
Types::Str
)
->WhereAdd(
'email',
$_POST['email'],
Types::Str
)
->Run();
//1