MySQL Display Help?
Hello there. I'm sure this has been asked many times before, but I wasn't able to find either on php.net or on these forums a way to solve my issue. I'm extremely new to PHP so it's all rather difficult to grasp but I'm inching along there. I'm trying to help out a friend with a problem he's having. What he needs is what I thought would be a fairly simple setup (but is turning out to be much more difficult than I expected!)
Needs to be able to have several moderators input data about banned users into a form. (Managed to get that done.)
Needs to be able to have certain fields of that data displayed in a specific way. Example: Grab a command from the MySQL Database, Grab the userID of the banned player, and grab the length of the ban from the database and display them in a single line, single spaced list (Eg. "ban 123456 1 week") (Managed to get this mostly done. For some reason it inserts an extra space so I get ban.123456..1 week (Periods would be where the spaces are.) But it's good enough to work.
Now sometimes the mods may not be able to get the userID. (People hacking, cheating the system, whatever). So they could only put in say the username and how long the ban is. So you'd get username.<Whitespace>..1 week. Which would mess with his being able to easily and smoothly grab those fields and input them into the server.
What I need some help figuring out how to show ONLY those values in the database which have a given field. (In this example, the userID).
I need to be able to change that value easily as well so that I can make another list with ONLY those values which have no userID and display only their in-gameID and username.
Then I also need to be able to display another list that only shows those users without either of the other options. (When the mods are unable to grab anything but the username itself.)
So we have the Username field. The gameID field and the userID field.
I hope this makes sense. I'm pretty brain fried after working on this for the past 20 hours straight. I've included the php file I am currently working with. This would be for the page that only shows the command, the userID and the length of time to ban. In one of my fields, this is what happens:
Cmd User ID Ban Length
ban 76561198163602169 100 years
ban 12561898132299268 100 years
ban 12561398165156458 100 years
ban 12561498163281945 100 years
ban 100 years
As you can see, the one on the bottom does not have a userID and thus will get in the way of making this list easily copy-pastable into our system.
Any help is greatly appreciated!