Dear all,
am trying to search in multiple tables for 1 database.
if i have a data base for the students with the following tables:
- table: names: contains the students names and id's and addresses
- table: marks: contains the same id's of table 1 and the marks, each column in this table called by a digit like column 1 named A, column 2 named B .. etc ..
- table: smart: contains informations about the student and his hobies.
now the problem that i want to make a form selects from the tables :
Each Student have the follwing:
- Name starts with 'AS' (Thats from the table 1 called 'names' and from the column 'snames')
- AND -
- His Hobie must be swimming (This is from the table 3 called 'smart' and from the column 'swimming')
- AND -
- His marks must be more than '50' (Tables 2 'marks' and column 'lastmark')
Now !!
Please let me know what to do after parsing the MySQL statment ..
and how i'll use the 'while' command to print the result ..
i think the statment of SQL must be:
"SELECT names.id, names.snames FROM names, marks, smart WHERE names.name='AS%' and smart.swimming='ON' and marks.lastmark>'50' "
and what to do then, and is that right .. ? and i dont know how to use the 'while' with it ..
to print the result ..
thanbks alot in advance for help ..