Jump to content
MakeWebGames

heavily modifying but need help on 1 part


Recommended Posts

Posted

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????

Posted

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.

Posted

$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

Posted

@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 =

Posted (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 by lucky3809

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...