Jump to content

Need $_SESSION help for final


mindlessrobot

Recommended Posts

I, for some unknown reason, decided to attempt to build my first social networking website for my senior project. I am sort of a dumb dumb when it comes to PHP. For what I am currently working on now I need to display "members" that go to the same "school" and start in the same "semester" according to whomever is currently logged in. I understand $_SESSION['userid'] = mysql_insert_id(); is tracking the current user, but how would I track other information attached to that current user. The "school" and "semester" are tracked within tables outside of the "user" table. :shrug:

 

Any help at all would be awesome. If you need anymore information let me know.

 

Thanks a trizillion.

Link to comment
Share on other sites

$_SESSION only holds the information you put into it.  To find out "members" that go to the same "school" as the current user and/or the people that started in the same "semester" as he/she, you have to query your database.

 

And mysql_insert_id(); retrieves the ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT).

 

If your really a dumb dumb when it comes to PHP my suggestion is to cram very hard cause there is no way your going to get a social networking website running without it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.