Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> How Do You Check Mysql Info, And Act According To It's Content?
gameratheart
post 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?
Go to the top of the page
 
+Quote Post
ghostrider
post 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.
Go to the top of the page
 
+Quote Post
gameratheart
post 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.
Go to the top of the page
 
+Quote Post
MaineFishing45
post 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.
Go to the top of the page
 
+Quote Post
gameratheart
post 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)
Go to the top of the page
 
+Quote Post
rvalkass
post Aug 27 2006, 08:44 AM
Post #6


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,156
Joined: 28-May 05
From: Devon, England
Member No.: 7,593
Spam Patrol



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.
Go to the top of the page
 
+Quote Post
gameratheart
post 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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Need Advice On Setting Up Mysql Database.(4)
  2. Cms/upload Best Practice?(12)
  3. Check This Totally Css Site Out(6)
  4. Flex, I Need Some Info And Help(6)
  5. Quick Question(10)
  6. The Nokia Morph (cellphone Uses Nanotechnology)(0)
  7. Mysql Database Size(7)
  8. Mysql Hacks(1)
  9. Girls: What "not" To Say To Guys!(40)
  10. The Book, Hanta Yo(1)
  11. Content Management System (cms)(13)
  12. Import From Excel File Into Mysql Database(11)
  13. Creating A Php Login System Using Mysql(10)
  14. Mysql Database Not Working(3)
  15. Downloading Content Using Rapidshare!(12)
  1. Data Structures -- String -- Palindrome(5)
  2. Mysql Database Setup : Setting Up Mysql Database(6)
  3. The Only Reason I Choose Ms Sql Server Rather Than Mysql(0)
  4. Mysql Db Is Down Getting Following Error(2)
  5. Ptsd (post Traumatic Stress Disorder)(4)
  6. Copyright Info(3)
  7. Short Info About About Apache Maven.(0)
  8. Subquery In Mysql(5)
  9. Regarding Content Language...(6)
  10. It Went Well For A While(5)
  11. Increment A Mysql Column(7)
  12. Complete Login System(57)
  13. Price Check(1)
  14. Pc Keeps Freezing - Help Please! Xd(6)
  15. Yoga(1)


 



- Lo-Fi Version Time is now: 8th October 2008 - 05:55 AM