Showing downline

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
arukomp
Forum Contributor
Posts: 113
Joined: Sun Sep 24, 2006 4:22 am

Showing downline

Post by arukomp »

Hi again everyone. Now I'm here with another question (problem maybe) :)

My script has to show member's downline (his referrals). But i came up with a problem - how can i do it.

I store all members data in Mysql database. Every member has "refid" field, which is their sponsor. I want to show one members downline. To show every member, where refid is 2, 15 or other member's id.

Can you help me? I can't think out anything. I thought to write everything in array, but i don't know how to extract all members all by one.

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm not sure how your database works, let alone the logic you're trying to accomplish.

Moved to Databases.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

I think you probably are asking how to write a simple SQL query. Please don't take offense, but when I see a question phrased as yours is, I wince, because it appears that you are trying to program for a database without a clue as to how databases work or how to use SQL language. That's certainly no crime, but it suggests that before you can use any advice that we might give, you need to spend many hours studying the basics. If you don't do that first, you will never figure out how to do what you want to do.
Post Reply