PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The info in the tables is taken from a database. Basically, on the left hand side I want people listed with a certain identifying variable, and on the other side people liisted with another identifying variable. Basically I want the script to be intelligent and put certain people in one category and the others in the other one
I sort of did it, but I'm getting the blank boxes. I'm not really sure how to correct it, here's my code:
i would suggest to create two separate tables WITHIN this table for each of your 2 groups querying one with shield and the other one with !shield (whatever that name was
I'm getting pretty much the same problem still- blank boxes, all be them alot skinnier now. What I guess happens is it looks through my database starting from the top, and if something doesn't have the variable "Hand" it just puts a blank box and continues on
yeah.. you're still echoing a <td> even if division isn't 'Hand' or 'Shield'. You could alter your query to only select those with a division of 'Hand' or 'Shield'
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
[quote="feyd"]yeah.. you're still echoing a <td> even if division isn't 'Hand' or 'Shield'. You could alter your query to only select those with a division of 'Hand' or 'Shield'[/quote]
Tried it, getting closer now!
New code:
Still have a few problems. The table rows are not lining up correctly, and what I would like to do is get alternating table colors for each new row. Before I had the "if ($i %2)" to set my table row colors but it does not work now
SELECT personal.username,
mainchar.mainname, mainchar.username, mainchar.title, mainchar.rank, mainchar.division
FROM personal, mainchar WHERE personal.username = mainchar.username AND mainchar.division IN( 'Hand', 'Shield' ) ORDER BY mainchar.mainname