Forum Moderators: coopster

Message Too Old, No Replies

Display Specific Records From Database

Display Specific Records From Database

         

jonspall

6:22 pm on Apr 28, 2009 (gmt 0)

10+ Year Member



Help! I'm sorry if this has been covered, but I'm a little stuck and can not find the answers to this little problem.

I need to display the heirachy of a committee, but in a certain order and in a 'family tree' type design. Obviously using repeat region to display all results in a list is easy, or even filtering the page to show just "Finance Committee Memebrs" is do-able.

However, I need to display specific records from a recordset on a web page. i.e. I would like to show only the information for finance committee members (ID 2, 4 & 5) and omit the rest, than maybe place the planning committee members (ID 3, 7 & 9) next to them. this make sense?

I am using PHP pages to connect to a mySQL database. I can easy do what I need by creating several seperate strings for each member . . .

$query_chairman = sprintf("SELECT * FROM fram_tc WHERE ID = 2",

$query_viceChairman = sprintf("SELECT * FROM fram_tc WHERE ID = 3",

but there must be an easier way? In HTML I can place any image anywhere on a page and simply tell it where the image is on the server?

I know I'm missing something really basic - but any help would be great

Thanks in advance - Jonny

LifeinAsia

6:25 pm on Apr 28, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Welcome to Webmaster World!

I would like to show only the information for finance committee members (ID 2, 4 & 5)

Use:
SELECT *
FROM fram_tc
WHERE ID IN (2,4,5)

jonspall

6:41 pm on Apr 28, 2009 (gmt 0)

10+ Year Member



many thanks for your reply, but how would I get ID=4 to display next to ID=5 for example? Creating a repeat region would list the results OK, but that's far from ideal. Also memebr ID=1 could appear on several committees.

The memebrs will regularly change you see, but the ID will alwways remain the same - The Fainance Chairman will always be ID=4 for example. Therefore placing a family tree type structure on the site makes things nice and easy

[edited by: coopster at 11:39 pm (utc) on April 28, 2009]
[edit reason] no personal urls please TOS [webmasterworld.com] [/edit]