Page 1 of 1

Calling same id from database

Posted: Tue Apr 19, 2011 6:35 am
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

Re: Calling same id from database

Posted: Tue Apr 19, 2011 7:05 am
by fugix
do you have any code for it yet?

Re: Calling same id from database

Posted: Tue Apr 19, 2011 7:30 am
by mickster69
not yet. still trying to figure it out

Re: Calling same id from database

Posted: Tue Apr 19, 2011 10:12 am
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

Re: Calling same id from database

Posted: Tue Apr 19, 2011 12:19 pm
by strafingmoose
So, basically, you generate a random number and want to use that same number later ?

Re: Calling same id from database

Posted: Tue Apr 19, 2011 1:04 pm
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