New to Mysql. help generating multiple query grouped html

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rponchek
Forum Newbie
Posts: 7
Joined: Sat Dec 28, 2002 10:33 pm

New to Mysql. help generating multiple query grouped html

Post 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...
User avatar
Elmseeker
Forum Contributor
Posts: 132
Joined: Sun Dec 22, 2002 5:48 am
Location: Worcester, MA

Post 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...
rponchek
Forum Newbie
Posts: 7
Joined: Sat Dec 28, 2002 10:33 pm

please contact me

Post by rponchek »

please contact me via email I would really appriciate the help

rponchek@mac.com

thanks
Post Reply