View Full Version : How to generate network diagram?

rane ^-^
04-21-2004, 10:39 AM
Hi, I'm Rane and I need some helps!

I have a member table in MySQL database. Each member have a 'referralID' which indicate their respective referral. The 'referalID' is refer to 'MemberID' field, that is, the referalID must be an existed valid MemberID in the table.

For example: C is a new member, his referal is B who have 5 subsidiary(C,D,E,F,G). B's referal is A and so on and so forth.

| | | | |

Now I have to write PHP program to retrieve these information from the database and draw the network diagram to the browser(by automatically).

I'd write the code to retrieve all members form the table and now I'd stuck here for a day! :confused: :mad:

Please do help me! Thank you.

04-22-2004, 01:50 AM
So you know what you've got in the database (by the way, a member that has no referralId, what value is stored there? That's important..).

What you need is a data structure in PHP called a graph to store the data in your database. You want to have a method of adding to the graph the relations in your database (ie. you need to add a node to your graph, and then add an edge between two nodes in the graph). Then you need a method of printing out the graph based on a root node in the graph.

I don't know of classes off hand, but I'll take a look for you. But hopefully that gives you a better idea of what you're looking at. If you already knew this, and you're looking for a ready-made script waiting for you, that might not work out so well.

Also try searching for things like family-trees (although this may limit a node to having only 2 referals.. but that shouldn't be too hard to modify), uml diagramers.. stuff like that.

Good luck,

rane ^-^
04-22-2004, 03:46 AM
Dear Sad69, thanks for your reply.

If a member do not have a ReferalID, the initial value will be 'CompanyName', which means that he/she is a immediate member of our company.

I've ask a friend and he told me there is no way to display a large family tree/network diagram through the PC's screen and also to the printer.

So now I'm thinking of discuss this issue with my supervisor and maybe I'll use another method to display it out.

Thank you.

06-13-2014, 12:45 PM
To design Network diagram or any other flow chart you can use any third party tool, these type of software allows you to design diagrams professionally. So it is recommended that use Network diagram designer software (http://www.softwaredownloadcentre.com/software/edrawmax.php) and make perfect network diagrams through its more than 6000 vector symbols.

06-13-2014, 09:39 PM
You would need to check out a 'family tree' or geneology script to see how they process the loops.