Flowcharting Help!!!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
colossus_09
Forum Newbie
Posts: 2
Joined: Mon Nov 09, 2009 7:47 am

Flowcharting Help!!!!!!

Post by colossus_09 »

We are planning to make a project entitled
Curriculum Flowchart generator.

We are using PHP and MySql for our database.

in the Subject table:
subNo as Pk
Description
Units
Prerequisite

After the creation of the curriculum,

*on the second column specifies the subjects prerequisite

Image

we have a functionality in which a flowchart will be generated
out of the curriculum made something like this;

Image

An arrow will point to the subject IT 120 because it is
a prerequisite of IT 110.


Question:
How can we code this in PHP?

We really need your help.
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

Re: Flowcharting Help!!!!!!

Post by JakeJ »

To start with, you need to normalize your data. Without that, you can't even begin to code it properly in PHP.

Table: Subject
id
description
units

Table: PreReqs
id
subject_id_master (id from Subject table for the course being offered)
subject_id_slave (id from Subject table for it's prerequisite)

In the PreReqs table, the id and subject_id field together make a unique key. Since many subjects can have many prerequisites, you must set up a many to many table as I have displayed. If there is no entry in PreReqs.subject_id then it means it has no prerequisite.

All that being said, following the normal rules of programming logic, you should be able to flesh out how to display your data properly provided you structure your queries properly.

If you don't know the normal rules, go through some tutorials, it's a bit too much to ask for here.
Post Reply