Page 1 of 1

New to Mysql. help generating multiple query grouped html

Posted: Sun Jan 12, 2003 9:06 pm
by rponchek
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...

Posted: Sun Jan 12, 2003 9:10 pm
by Elmseeker
I could write something like this up for you rather easily but I'd need to see how you have your DB set up, ie: what fields and tables you use...

please contact me

Posted: Sun Jan 12, 2003 9:12 pm
by rponchek
please contact me via email I would really appriciate the help

rponchek@mac.com

thanks