lordjordysmith;10987102 wrote:
does that mean i need to make id username since the username is what is used to login
What's "used" to login doesn't matter. It's your system. You can pull anything you want from the db. You can store anything you like in $_SESSION (well, except for stuff that can't be stored there, such as resources but that's besides the point here).
lordjordysmith;10987102 wrote:
if so how do i go about this because i tried changing id to username and i just got a blank page
Well, you just can't change willy nilly between identifiers.
page 1
session_start();
$_SESSION['username'] = 'joe';
page 2
echo $_SESSION['userid'];
Without actually storing userid in $_SESSION, what would you expect happens in the second script?
lordjordysmith;10987102 wrote:
i just got a blank page
Change php.ini. error_reporting = -1 or E_ALL. display_errors = stdout in dev enrivonment. log_errors = /path/logfile in both prod, dev and test environments.
If you don't enable error reporting, you will get blank pages as soon as you have a parse error, not to mention missing lots of other things you really should be aware of.
Other than that, I never see you use session_start() or store anything in $SESSION. While some other script, that I don't see, may have stored things in $SESSION, you never use start_session() in this script.