Page 1 of 1

Flowcharting Help!!!!!!

Posted: Sat Mar 06, 2010 6:56 am
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.

Re: Flowcharting Help!!!!!!

Posted: Mon Mar 08, 2010 8:28 pm
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.