When a user is logged in, I want him to see the Course he did and his Results.
At the moment I have this:
<?php
session_start();
if(isset($_SESSION['user'])) {
$query = "SELECT applied_cours, stud_res FROM students";
$result = mysql_query($query);
while($student = mysql_fetch_array($result)) {
echo "<p>" . $student['applied_cours'] . "</p>";
echo "<p>" . $student['stud_res'] . "</p>";
}
}
?>
The problem is is that this will show all the courses and results of everybody, not only from the logged in user. Does anybody know how to fix this?
The table I use goes like this:
username, password, stud_id, studgr_id, applied_cours, stud_res
user1, password1, 6567, 2012_1, timemanagement, satisfactory
user2, password2, 8459, 2012_2, timemanagement, satisfactory
etc.