„threadr/profile/index.php“ ändern
parent
65ac991632
commit
5023fa34fd
|
@ -6,10 +6,18 @@ session_start();
|
|||
%REQUIRE_LOGIN%
|
||||
|
||||
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
|
||||
$statement = $pdo->prepare('SELECT name FROM users WHERE id = :user_id;'); // to be replaced with optional user name off the user data table
|
||||
$result = $statement->execute(array('user_id' => $_SESSION['user_id']));
|
||||
$dbentry = $statement->fetch();
|
||||
$username = $dbentry['name'];
|
||||
$error = false;
|
||||
$error_message = "";
|
||||
if (!$error) {
|
||||
$statement = $pdo->prepare("SELECT name FROM users WHERE id=:uid"); // to be replaced with optional user name off the user data table
|
||||
$statement->execute(array("uid"=>$_SESSION[user_id]));
|
||||
$dbentry = $statement->fetch();
|
||||
$username = $dbentry[name];
|
||||
}
|
||||
if (!$result) {
|
||||
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
|
||||
}
|
||||
|
||||
|
||||
$navbar = "profile";
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue