Hi, all I have a website in which the user will register and write something called "RSSTFFT" which is represented in database as VARchar, this "RSSTFFT" is similar to "NUMBER" of another user...........what I want to do is :- when the username get through the profile he/she will see a table similar to this picture ( i can do this table but I want the code for the following system), in each cell (person) the "username" will be represented under the user whose its (( "NUMBER" equal to "RSSTFFT" of entered by the lower user)) i.e ( when the "two yellow" persons registered they entered a field called "RSSTFFT", this field equal another field called "NUMBER" belongs to the red person....(this is the problem), the yellow persons can see the green and blue..etc but not the red person in their profile (this is not a big problem), the colors of the persons are their username which will be represented in the cells
Alright not to sound like a rtard, but could you simplify your problem? If I understand correctly you want to use PHP to pull data from the database to create a table with the usernames of the people bellow eachother (aka so that the red guy can see the names of the yellow, green and blue guys in a chart)... In that case you'd use a while() statement with one or two queries inside of it to pull the data... Obviously this is all guess work, if you simplify your question and make it easier to understand and possibly post a database structure example I could code up something that could help you.
thx for your reply, 1- I know that I have to use while function, but I don't know how.....Please help me 2- about the question:- here you are an example you will register in the website and insert these data:- A-username is "BlueVM" B-Number is "20" C-RSSTFFT is "35"....................these data will be saved in my database.ok Now I will register in the website and insert these data:- A-username is "masterofzoo" B-Number is "80" C-RSSTFFT is "20"........................Now my RSSTFFT = your NUMBER (20), so that:- you will have masterofzoo under you in this picture, if you are the red person I will be one yellow...............
Alright that helps a lot here is a general example that will "print" the names of the people bellow you in the yellow based on the user's number... The variables since I don't know the names have been substituted as follows: $username - the username of the person currently logged in. $number - the number of the person currently logged in $data_referals - the query's data contain's data pulled from the database matching the user's $number <?php // This assumes that the script is already connected to and has selected a database. // Basic mysql query asking the database to match all accounts that have an RSSTFFT equal to the user's number. $pull_referrals = mysql_query("SELECT * FROM accounts WHERE RSSTFFT='$number'") or die(mysql_error()); // Basic while loop. while($data_referrals = mysql_fetch_array($pull_referrals)) { // This filters down the data provided so that it saves the number of the person(s) who are bellow the person currently logged on. $referral_number = $data_referrals['number']; // This queries the database asking for the username that matches the person(s) number's that we've just collected. $pull_username = mysql_query("SELECT * FROM accounts WHERE number='$referral_number'") or die(mysql_error()); $username_data = mysql_fetch_array($pull_username); // This puts the username into a temporary variable for printing $referral_username = $username_data['username']; // This prints the username we've just queried for. echo $referral_username; // End basic while loop. } ?> Code (markup): If after looking through that you aren't able to figure out exactly how to go about building and adding on to it or how to modify it to meet your needs I'll gladly assist you for $25.00 (negotiable based on how much you really need done) in creating the entire script.