I came across the following code while constructing a php file:
$query="UPDATE EXPERTS SET ...";
$result=$db->query($query);
if ($result)
{
$query="UPDATE USERS SET ...";
$result=$db->query($query);
if ($result)
{
...
}
}
My question is if the above nested query is acceptable since we use the same variable ($result). Of course, it works, however I am not sure if is there any case of creating unexpected results...
Thank you
$resultoverwrites the other$result. If you're good with that, then OK.UPDATEquery produces onlytrue/falseas its output. There's no result set in$result(unless you are using a strange custom class)