$query = "INSERT INTO comenzi (tip, litri, adresa, user_id)
VALUES($tip, $litri, $adresa, $_SESSION['user']['id'])";
mysqli_query($db, $query);
$query = "INSERT INTO comenzi (tip, litri, adresa)
VALUES('$tip', '$litri', '$adresa')";
mysqli_query($db, $query);
$_SESSION['username'] = $username;
$_SESSION['success'] = "You are now logged in";
$_SESSION['user'] = $results->mysqli_fetch_assoc();
class User
{
public static $id;
public static function get()
{
//Делаем запрос к БД по self::$id
}
}
User::$id = 1;
User::get(); // Вернется пользователь с id = 1
Yii::$app->queue->push(new ImportQueue(['data' => $items]));