Re: Displaying information from table graphically

From: Date: Fri, 21 Nov 2008 16:55:09 +0000
Subject: Re: Displaying information from table graphically
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-283638@lists.php.net to get a copy of this message
dzenan.causevic@wise-t.com wrote:
I have a PHP application that accesses data from MySQL. There is table called "rooms", and table called "beds". There is another table called "patients". Patients are being placed into beds, and beds are in the rooms. PHP application currently displays all information in textual mode via regular HTML tags. But I would like to have that information displayed in graphical mode instead of textual mode. Is there a way to display this information from the database graphically. Graphic would represent a room, and it would contain beds inside. You would be able to see visually which beds are occupied and which are free by looking at the graphics. User of the system wants pictures instead of text displayed via HTML tables as a list of entries. Anyone knows anything like this? Thanks, Dzenan
general idea: in mysql you have marked beds with 0 not occupied and 1 occupied. then you have two images: bed_occupied_0.gif and bed_occupied_1.gif and, depending on record from mysql different image should be shown. same with number of beds in room. for example. there is 4 beds maximum per room. you have 5 images no_of_beds_0.gif (actually, this is a transparent 1x1 gif) images no_of_beds_1.gif images no_of_beds_2.gif images no_of_beds_3.gif images no_of_beds_4.gif $query = mysql_qurey("select no_of_beds from beds where room=123"; $result = mysql_fetch_assoc($query); echo "<img src="images/no_of_beds_".$result['no_of_beds'].".gif" border=0 />"; something like that. -afan

« previous php.general (#283638) next »