At0mic Posted June 15, 2006 Share Posted June 15, 2006 i want to modify a php/mysql database for the small college I work forIts a database containing student infomation and what courses they are doing. The problem is, it only contains the course codes - not the actual names of the courses. Members of staff have to look up the code to see what course it is.I dont wish to edit every student becasue there's far to many.I tried the following PHP code which displays the word "hairdressing" if it finds course code 100410IC001:if ( $course_id == "100410IC001" ) { echo "hairdressing";}else echo "course name not found";some students are doing more than one course. Although the above code works if the student is doing one course, if they are doing multiple course, it displays the word "hairdressing for each course (even though they have different ID codes.doing it this way isn't very good anyway. I want to make use of MySQL so people can add more courses using a form. I added a new table to the MySQL database containg courses and theirs codes. I want it to look up the course id in my new table and display its course name. Ive been having problems doing this.Please can anybody give some advise on the best way to do this?Many thanksAt0mic Link to comment Share on other sites More sharing options...
phkninja Posted June 16, 2006 Share Posted June 16, 2006 (edited) give us an idea as to what the different course coses are, and also are all the students referenced by course?By the way as a matter of intrest is th eindex the student name or what is it?need to know to try and make the cod distinguish between courses and students. Edited June 16, 2006 by phkninja Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now