supanoob Posted July 10, 2007 Share Posted July 10, 2007 Well basically what i want to do is this: I want to find an ammount of the same thing and echo it once but next to it have how many of that thing there are in a table. So say i have 10 wooden swords i want it to echo the image of the sword once and show x10 next to it to show that it is in the database 10 times. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 10, 2007 Share Posted July 10, 2007 Can you see if I'm right here. You've got a table that contains quantities of things. When the amounts of each item is pulled from the table you'd like the item description, a picture of the item and the quantity to be shown? Quote Link to comment Share on other sites More sharing options...
supanoob Posted July 10, 2007 Author Share Posted July 10, 2007 yeah thats pretty much it, as it stands i have each of the items showing but i have alot of 2-3 of the items so i want just 1 to be shown and the quantity of the rest to be next to it. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 10, 2007 Share Posted July 10, 2007 To pull only one of many of the same items from the table use DISTINCT() SELECT DISTINCT(`id`) FROM table You could use switch() on something like the `id` to link to an image stored on the server. Quote Link to comment Share on other sites More sharing options...
supanoob Posted July 10, 2007 Author Share Posted July 10, 2007 ive sorted it thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.