setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); /*** prepare the insert ***/ $stmt = $dbh->prepare("SELECT aus_fullname FROM aus_users WHERE aus_user_id = :aus_user_id"); /*** bind the parameters ***/ $stmt->bindParam(':aus_user_id', $_SESSION['user_id'], PDO::PARAM_INT); /*** execute the prepared statement ***/ $stmt->execute(); /*** check for a result ***/ $aus_username = $stmt->fetchColumn(); /*** if we have no something is wrong ***/ if($aus_username == false) { printMessage('Error','Access Error'); die(); } else { $message = 'Welcome '.$aus_username; } //check if the user has a wish for this semester $stmt = $dbh->prepare("SELECT count(id) FROM aus_wishes where user_id= :user_id and semester = :semester"); /*** bind the parameters ***/ $stmt->bindParam(':user_id', $_SESSION['user_id'], PDO::PARAM_INT); $stmt->bindParam(':semester',$semester, PDO::PARAM_STR); /*** execute the prepared statement ***/ $stmt->execute(); /*** check for a result ***/ $test = $stmt->fetchColumn(); if($test == 0) { $stmt = $dbh->prepare("INSERT INTO aus_wishes (user_id,semester) values (:user_id, :semester)"); /*** bind the parameters ***/ $stmt->bindParam(':user_id', $_SESSION['user_id'], PDO::PARAM_INT); $stmt->bindParam(':semester',$semester, PDO::PARAM_STR); /*** execute the prepared statement ***/ $stmt->execute(); } // fetch the wishes for this user. $stmt = $dbh->prepare("SELECT * FROM aus_wishes WHERE user_id = :user_id AND semester = :semester"); /*** bind the parameters ***/ $stmt->bindParam(':user_id', $_SESSION['user_id'], PDO::PARAM_INT); $stmt->bindParam(':semester',$semester, PDO::PARAM_STR); /*** execute the prepared statement ***/ $stmt->execute(); //while($val = $values = $stmt->fetch(PDO::FETCH_ASSOC); $first = $values['first']; $second = $values['second']; $third = $values['third']; // fetch the courses list from the database. $stmt = $dbh->prepare("SELECT * FROM aus_courses ORDER By id"); /*** execute the prepared statement ***/ $stmt->execute(); while($val = $stmt->fetch(PDO::FETCH_ASSOC)) { $courses[$courses_count] = $val['id']; $courses_names[$courses_count] = $val['name']; $courses_count = $courses_count + 1; } $user = getUserByUserID($dbh, $_SESSION['user_id']); if(!$user) { printMessage("Error", "Cant get user information."); die(); } $userName= $user['aus_fullname']; } catch (Exception $e) { /*** if we are here, something is wrong in the database ***/ printMessage('Error','We are unable to process your request. Please try again later.'); die(); } } ?> AUSCSE Wish list

CSE Courses Wishlist

Select the CSE courses you wish to register in Fall 2017


*Kindly take note of the following before submitting your wish list: