commented backgroundupdate.php

This commit is contained in:
Thies Mueller 2021-01-12 17:13:49 +01:00
parent ee804b16a3
commit 05b9ad12fa

View File

@ -1,12 +1,12 @@
<?php
session_start();
session_start(); //first we need a session to store the data into
include 'db.inc.php';
$username = $_SESSION['username'];
include 'db.inc.php'; //and a db connection
$username = $_SESSION['username']; //then we get the username from the session
$statement = $pdo->prepare("SELECT * FROM users WHERE username = :username");
$statement = $pdo->prepare("SELECT * FROM users WHERE username = :username"); //building a statement & getting the whole line of username = $username
$result = $statement->execute(array('username' => $username));
$user = $statement->fetch();
$user = $statement->fetch(); //putting the stuff in an array and afterwards store it in the session:
$_SESSION['userid'] = $user['id'];
$_SESSION['email'] = $user['email'];
$_SESSION['username'] = $user['username'];