Daron Posted April 22, 2011 Author Posted April 22, 2011 i think i know away to get things right but i need to be able to stop the whole accept or decline feature. so it needs to be able to automatically make u the persons student once u type in their id #. so anybody know how to remove it so it automatically makes you student without having having to accept???? Quote
lucky3809 Posted April 22, 2011 Posted April 22, 2011 You should make a new table call it students then add... userid student_one student_two student_three student_count .... Much easier then the way your doing it... then add the queries where they need to be. Quote
rulerofzu Posted April 22, 2011 Posted April 22, 2011 $q = mysql_query("SELECT userid, username FROM users WHERE sensei = {$r['userid']}"); $students = "Students:"; $sep = 0; if(!mysql_num_rows($q)) { $students .= " N/A"; Of course it will return 1 Look at your query your not asking about students your asking if there is a userid with your userid result = 1 Quote
Daron Posted April 22, 2011 Author Posted April 22, 2011 how would i fix it???? i thought that had sounded right. Quote
Analog Posted April 22, 2011 Posted April 22, 2011 @rulerofzu - if it is a default viewuser.php file then $r is the result of the query ran to pull that players info for the profile, $ir is the player signed in looking at the profile @Daron - change sensei = to student = Quote
Daron Posted April 22, 2011 Author Posted April 22, 2011 it still returns a N/A as the result hmmmmmm. Quote
lucky3809 Posted April 23, 2011 Posted April 23, 2011 (edited) Here dont know if this is what your aiming for or what but in viewuser under the query that grabs all the user info place $s=$db->query("SELECT userid, username FROM users WHERE userid={$r['sensei']}"); $stud=$db->fetch_row($s); if($r['sensei'] != 0){$stu= "<a href='viewuser.php?u={$stud['userid']}'>".$stud['username']."</a>";} else {$stu= "<font color=red>Single</font>";} and in user profile under the name: stuff add Students : $stu Edited April 23, 2011 by lucky3809 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.