Create Session variables out of everything in a mysql table

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
2,708
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jul 17, 2009

Scenario: Your making a website that uses user logins. Pretty common. When the user logs in you want to store all their mysql data in session variables so that while they are logged in you can access things like their email, products, names, address and anything else you put in the user table of your database. You could pick and choose which rows of mysql you wish to turn into Session variables and hard code them in. But with the foreach loop and some trickery we are able to turn everything from the user table about a particular user into session data.

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (optikalefxx)

  • can you help with this syntax error i made this script but not displaying the data from the database

  • @Jamieduk999 sure send me some code

see all

All Comments (7)

Sign In or Sign Up now to post a comment!
  • Even a better way, use mysql_fetch_assoc instead of mysql_fetch_array

  • Thanks!! I was looking for related info and your tutorial was very useful

  • thanks this helped alot

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more