gwh Posted February 11, 2010 Share Posted February 11, 2010 Hi everyone, I have a garments table in my database where each row represents one garment. These garments will be output to the browser in a slideshow application. Each slide in the slideshow displays an image of the garment as well as information about it. Some of the images consist of two garments, ie. both a men's garment and a ladies garment in the one shot. With these dual images, both the men's and ladies information need to be output on the one slide. Since each of the rows in the database table represent one unique garment, be it men's or ladies, I was going to create two SQL queries - one each for both the male and female garment types. The result set would depend on whether a column in the garments table is set to either male or female. One of the columns in the garments table is for a title so if a 'dual' men's/ladies image is used on a slide, this means that the title for each of these garments in the database table will be the same since they're being output together. An example title would be "men's and ladies co-ordinate shirts". So since both of these two rows that are being output to the one slide will have the same title, I need to find a way to make sure it's output just the once. I'm assuming I'd need to add another column to the table with information on whether the image is dual or single but I'm not sure how I'd approach it with the php. I mean would I have to create a third SQL query that pulled down the titles separately based on this extra column? Could someone maybe comment on this and maybe provide some sample code? Really appreciate any advice. Link to comment https://forums.phpfreaks.com/topic/191757-limiting-output-from-the-database/ Share on other sites More sharing options...
jl5501 Posted February 11, 2010 Share Posted February 11, 2010 Have you started to do this, and do you have any code you have tried so far, that you can show? Link to comment https://forums.phpfreaks.com/topic/191757-limiting-output-from-the-database/#findComment-1010707 Share on other sites More sharing options...
gwh Posted February 11, 2010 Author Share Posted February 11, 2010 No I haven't started on the php yet, I've only got the database happening. I just wanted some input so I could proceed in the right direction. Link to comment https://forums.phpfreaks.com/topic/191757-limiting-output-from-the-database/#findComment-1010710 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.