Results 1 to 9 of 9
Thread: Relational queries in PHP/MySQL.
Dec 29, 2000, 00:09 #1
- Join Date
- Dec 2000
- 0 Post(s)
- 0 Thread(s)
I'm completely new at this, and the book I purchased on PHP does not show examples of how to write mysql queries based on relational databases. They only show how to retrieve data from 1 database at a time.
Can someone give me some example queries. I would greatly appreciate the help. Here are the tables I am working with:
Database name: du
StudentID <---relational to ID in Student table
This query works in Mysql, but not in php:
SELECT Classes.Course, Classes.Section,Classes.Credits,Classes.Term,Student.FirstName,Student.LastName,Student.College,Student.Major,Student.PhoneNumber,Student.GPA FROM Classes, Student WHERE Student.ID = Classes.StudentID;
If you are curios, let me explain what I am doing. I have 2 tables in the database "du". The tables are "Student" and "Classes". I intend to have multiple records in "Classes" for each "Student". I know I should break classes into 2 separate databases, but there are way too many classes I would have to input, so I want to keep it the way it is(even though there will be redundant data). I'm doing this for my organization in College. A study group / reporting database in a sense.
Thanks a lot.