The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Session Confusion Reply To: Session Confusion


I’ve almost got it. I can log-in, create a session for the username and insert that username into the table. What I don’t understand is how to display the username back when showing the stored comments? This is how I display the stored data :

`WHILE($board = mysql_fetch_array($result)):

$cmtusername = $board[‘$username’];
$cmtsubject = $board[‘subject’];
$usercomments = $board[‘usercomments’];
$rating = $board[‘rating’];
$cmtdate = $board[‘dateofcomment’];
$timestamp = strtotime($cmtdate);
$new_date = date(‘j F Y, g:i a’, $timestamp);`

I named the session $user and set the $cmtusername variable to ‘$username’, ‘username’ (which is the name of the field) and also the name of the session ($user) but as the username is a session and not entered in the form itself I’m guessing this isn’t the way to do it?