Jump to content
xisto Community
gameratheart

How Do You Check Mysql Info, And Act According To It's Content?

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

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)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.