please I need your help I watch a lot of videos and I follow them step by step and I cant handle this problem
im using the session tag from the sign-up page and use it at the user panel to fetch his data from the userdata table in the database so it means every user sign up its must the remember his new user that been accepted and use it here to fetch his data hope I make it clear the prob is I cant fetch data using a variable in my example is $signinup
<?php
session_start();
$serv = '127.0.0.1';
$user = 'root';
$pass = 'root';
$dbname = 'akbase';
// db base connection
$pdo = new PDO('mysql:dbname='.$dbname.';host='.$serv.'; charset=utf8',$user,$pass);
/* i want to use the Session to fetch data from database
the value of this session tag is any new sign up user name
and by using echo it show me the value of any new user */
echo $signinup = $_SESSION["username"] ;
$password = $_SESSION["password"] ;
// here i use prepare statment
$sql = 'SELECT * FROM usersdata WHERE username = :useruser';
$statement= $pdo->prepare($sql);
$statement->execute(':useruser'=>$signinup);
$data = $statement->fetchObject();
echo $data->username ;
?>
this is the database table