New to Mysql. help generating multiple query grouped html
Posted: Sun Jan 12, 2003 9:06 pm
Please help. I am new to mysql. Need help on page. I am trying to create a "printer-freindly" Listing of my database. I will do my best to explain. I am developing a php/mysql database to keep track of patients at various hospitals that I go to. To make a printer friendly version of this database , i want to query the database over and over, but display my results for each query. i.e. I want the resulting html to display Hospital1 results with each patient in that hospital in a table below, then Hospital2 with each of the patients under it, etc... etc. I did this originally by doing a select where hospital_ID = 1, then html to display, then repeated all my code for each hospital changing the query. This fails when I add new hospitals to the database because I have to add additional code. Is there a way to make the query have a variable for hospital_ID, and the code repeat until there are no more hospitals? I also have to be able to display "no patients admitted" if no results are found for a particular hospital. Thanks so much in advance for any help...