1
I’m an Intermediate Programmer, and I’m at an impasse, I need to display some items and what’s missing I need you to fill out with a mayor model. Let’s explain the logic ok?
In My Table (I will use examples ok?) ITEMS, you can add a maximum of 20 ITEMS (Up to ae, everything ok.).
Let’s assume I have 12 rows in the ITEMS table like this [id]1[tipo_item]1
. Namely from ID1
i have 12 items. To complete the limit of 20 missing 8, correct?
Now I need to show off like this:
Items: (id is hidden no need to show)(ie no need to pull the variable $id.)
[tipo1] [tipo1] [tipo1] [tipo1]
[tipo1] [tipo1] [tipo1] [tipo1]
[tipo1] [tipo1] [tipo1] [tipo1]
(now comes the problem) the 8 "remaining voids" needed you to show so
[Vazio] [Vazio] [Vazio] [Vazio]
[Vazio] [Vazio] [Vazio] [Vazio]
I need the code to show all items in grid, in a total amount per page I select. but I need it to do a type account
20 - $quantidade de linhas
(in the case remaining 8) and the one left over shows an empty slot. (or an. x of images (e.g., empty.png)(or a text (empty)
See if this sql solution helps http://forum.imasters.com.br/topic/288300-consulta-sql-difcil/#entry1048056
– Motta
It is good to take half of these tags there and decide if you want in PHP or JS. I’m responding in PHP, but since you’re an intermediate programmer, I think it’s easy to adapt to JS if you need.
– Bacco