I am not sure if its going to work. this is what my table 'collegiate' looks like:
id user_id first last year age gender last_change
1 1 John Erickson sophmore 22 m
2 2 billy boy junior 19 m
6 2 tobby adams freshmen 23
7 2 asd john senior 20 m
as you can see the user_id is tied to the users table 'id' for each registered user.
id login
1 millern
2 millerp
this code here:
$current_user = $_SESSION['id'];
// matches the session 'id' of login user with the 'user_id' field from the talbe collegiate so that we can select the right content to be displayed
$logged_id= mysql_query( "SELECT * FROM collegiate WHERE collegiate.user_id = '$current_user'");
// gets the result from collegiate table, there one uniqueid tied to the rows.
$result = mysql_query("SELECT * FROM collegiate WHERE collegiate.user_id= '$logged_id'") or die('Error : ' . mysql_error());
echo "$result";
i am trying to get the table users 'id' of the logged in person and match it to the table collegiate 'user_id' and from that have the correct information display for whoever is logged in by looking at the id.
I am having trouble accomplishing this.