Calling same id from database

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!

Moderator: General Moderators

Post Reply
mickster69
Forum Newbie
Posts: 5
Joined: Thu Apr 14, 2011 7:31 am

Calling same id from database

Post by mickster69 »

Hello everyone

I'm having a problem trying to figure out how to call the same id from the database. I am creating a card game and will be using a different image so that when a player picks a card, they wont know what card is being picked. The card that is being picked would have the same id. I am creating a second table on the database so that they can have the same id.

My cards get selected randomly and I want the opponents card to appear in the same order and id number.

Could someone help me by telling me how to do this?

Thanks
fugix
Forum Contributor
Posts: 207
Joined: Fri Mar 18, 2011 8:01 pm

Re: Calling same id from database

Post by fugix »

do you have any code for it yet?
mickster69
Forum Newbie
Posts: 5
Joined: Thu Apr 14, 2011 7:31 am

Re: Calling same id from database

Post by mickster69 »

not yet. still trying to figure it out
fugix
Forum Contributor
Posts: 207
Joined: Fri Mar 18, 2011 8:01 pm

Re: Calling same id from database

Post by fugix »

well to call the same id out of a database i would use "where" in my mysql_query telling it to grab certain data where a specified condition is met
strafingmoose
Forum Newbie
Posts: 15
Joined: Mon Apr 18, 2011 2:56 pm

Re: Calling same id from database

Post by strafingmoose »

So, basically, you generate a random number and want to use that same number later ?
mickster69
Forum Newbie
Posts: 5
Joined: Thu Apr 14, 2011 7:31 am

Re: Calling same id from database

Post by mickster69 »

yes. The numbers stays the same for each card and when a new player picks that card, it moves onto their hand.

It's like if I had a hand of 1, 2, 3 and 4 and on your hand you had 6, 3, 8 and 7. I pick a card from you and won't know which one is picked until its placed onto my hand
Post Reply