Go home.'; } if (!isset($_GET['id'])) { nobody_is_here(); } else { // If this is the user's own page, show the 'options' bar echo '
'; $sql = 'SELECT user_id, user_name, user_date FROM users WHERE user_id=?'; $stmt = mysqli_stmt_init($dbc); if (!mysqli_stmt_prepare($stmt, $sql)) { die('Could not create thread due to internal error: ' . mysqli_error($dbc)); } mysqli_stmt_bind_param($stmt, 'i', $_GET['id']); mysqli_stmt_execute($stmt); $res = mysqli_stmt_get_result($stmt); $user = mysqli_fetch_assoc($res); if (!$user) { nobody_is_here(); } else { echo '

'. $user['user_name'] .'

'; echo 'Member since '. date('M d, Y', strtotime($user['user_date'])); } if ($_SESSION['user_id'] == $_GET['id']) { echo '

Change Password

'; } echo '
'; $sql = "SELECT thread_id, thread_subject, thread_date, user_id, user_name, cat_id, cat_name FROM threads JOIN users ON thread_author = user_id JOIN categories ON thread_cat = cat_id WHERE thread_author = " . $user['user_id'] . " ORDER BY thread_id DESC"; $result = mysqli_query($dbc, $sql); if (!$result) { die('Error trying to display threads: ' . mysqli_error($dbc)); } echo ''; display_threads($dbc, $result, true); mysqli_free_result($result); echo '
' . $user['user_name'] . '\'s ThreadsLatest Post
'; } ?>