|
|
|
|
![]() ![]() |
Aug 27 2006, 01:51 AM
Post
#1
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 505 Joined: 14-November 05 From: Britannia! Member No.: 14,287 |
As part of a web-game on my site, I have a php form that requires people to enter their username, and information about the characters they want to have in the game. All this information is stored into a MySQL table. I want the players to be able to visit a page where every character they have registered with their username can be seen.
My question is simply, how can I check the values of the MySQL data, and act accordingly? What I need to do is check for a Username and a character number, and if it finds it, takes the data in that part and acts on it, eg. by showing the picture of the character and the information they gave about it. Does anyone know how I can do this? |
|
|
|
Aug 27 2006, 02:36 AM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 397 Joined: 9-June 06 From: Wisconsin Member No.: 24,924 |
You can do this by counting the number of user names and then using a select query. I can help you out with this if you want.
|
|
|
|
Aug 27 2006, 02:52 AM
Post
#3
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 505 Joined: 14-November 05 From: Britannia! Member No.: 14,287 |
Well I was kind of thinking, use a select query that searches for the username and the character number, then somehow use the selected data. If you can help me with this, ghostrider, it would be much appreciated.
|
|
|
|
Aug 27 2006, 02:55 AM
Post
#4
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 275 Joined: 17-February 06 From: Wellesley, MA Member No.: 18,774 |
So you want a page that displays the SQL information (its values) into something graphical? So pretty much you want a Profile or Registered users page?
Umn.... give me some time to reseach that, but in the mean time ask GhostRider. Also if you want to find the values, just login to Cpanel and find PHPMyAdmin and that should tell you. |
|
|
|
Aug 27 2006, 03:10 AM
Post
#5
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 505 Joined: 14-November 05 From: Britannia! Member No.: 14,287 |
Well... in effect it is a profile page, because it is a page showing what a user has, but it isn't really talking about the user.
QUOTE Also if you want to find the values, just login to Cpanel and find PHPMyAdmin and that should tell you. Talk about stating the bloody obvious! (Sorry, that was uncalled for, but I think I've already demonstarted that I know how to get MYSQL data - I just don't know how to use it) |
|
|
|
Aug 27 2006, 08:44 AM
Post
#6
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,156 Joined: 28-May 05 From: Devon, England Member No.: 7,593 ![]() |
Your best option will be to write a select query for all rows featuring the current logged-in user's name. The use mysql_fetch_array to get an array of data. If you use a while loop to cycle through the array you can print out the character number or whatever, or use the data as variables to look up an image or other information. I can help as well if you want, either via PM, email or IM (check my profile). I use MySQL a lot and have a few examples of how to use mysql_fetch_array.
|
|
|
|
Aug 28 2006, 03:09 AM
Post
#7
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 505 Joined: 14-November 05 From: Britannia! Member No.: 14,287 |
The more help I get, the better. You're methods are making sense, but I can't seem to put two and two together and come up with something productive.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 8th October 2008 - 05:55 AM |