Click to See Complete Forum and Search --> : is this type of database possible?


ramram
07-26-2006, 11:39 PM
(This is very simple, yet my very first database project so I do need a little help)


I want to make something like this,

If you type one of the students name, the results will show you His major and date of graduation.

For example:

Dave Biomedical engineering 2008
Cris Chemistry 2010
Frank Computer 2007

I just need a search box where I can type the name and then the results will show the name, mojor, and graduation date. I can do a bit of html and php coding but I have no idea of how I can create such database using mysql.

Thanks for taking your important time to read this thread.. Have a nice day!

aussie girl
07-27-2006, 12:50 AM
Well I would create a table for;
Students with all their personal info
Then one for courses with all that info
then one called enrollment which has the student_id, course_id, date_enrolled, graduation date
So three tables that's at the very basic level you can add more info but this would be a start..

Then to get the info..

SELECT first_name, last_name, course_name, graduation_date
FROM students, courses, enrollment
WHERE student_id = enrollment.student_id
AND courses.course_id = enrollment.course_id;

ramram
07-27-2006, 03:15 AM
How can I just search only one student name at a time?

themarty
07-27-2006, 03:29 AM
AND/WHERE first_name LIKE '%[value from search form]%'if you want, for example 'lex' also to match 'alex' or 'alexis'

and otherwise justAND/WHERE first_name = '[value from search form]'