I want to get the session ID from the current user login , but there's something missing in my code, what is it, please help.
i have already added a Resort, and all i want to do is I want to list the resort what user created.
function resorts_list()
{
$db = ligoanandb();
$ownerid = session_id();
$sql = " SELECT * FROM resort WHERE ownerid = $ownerid order by 1
desc";
$st = $db->prepare($sql);
$st->bindParam(':ownerid',$ownerid, PDO::PARAM_INT);
$st->execute();
$rows = $st->fetchAll();
$db = null;
return $rows;
}
there's no result the resort does not list the current user's resort.