So yeah, iim just curious to see what people would prefer.
WHERE author = '$user_id' OR WHERE author = '$username'
author
Referring to the user by his ID or by his Username...
Let me know what you think...oh and why :-)
User id 'cos
users change their names for legitimate reasons and you don't want to have to update them across 100s or 1000s of records.
integer indexes process faster than text indexes.
Thanks for the response, and wow i had no idea that integer index's process faster.. .Cool stuff :-) Thanks. I am building a members type site and was just curious about all of this. So what do you think instead of doing $SESSION['username ']; I do $SESSION['id'];
Thanks again :-)
Just store both in session. User logs in and you validate against database, returning all the user data when the login is valid. You store all that data as session vars so that you have the id to use in queries and the name to use in the page display like 'Hello Joe, welcome back.'