Echo Table

C++, C#, Java, PHP, ect...
Post Reply
User avatar
OoZI
Posts: 109
Joined: Mon Jan 02, 2012 4:22 pm

Echo Table

Post by OoZI »

Hey guys, I am working on my game and I am trying to make the battle page. I want it to show all of the enemies and there stats with an attack button.

How would I echo my MySQL Table with a battle option in each row so when you hit the button for that row, it puts you in a battle against that enemy?
-OoZI

My Blog
User avatar
Nexus
Posts: 293
Joined: Sat Jun 18, 2011 10:42 pm

Re: Echo Table

Post by Nexus »

You would do it the same way as you get everything in a shop using a while loop

Code: Select all

while($creatureget3 = mysql_fetch_array($creatureget2){echo your table as you would a shop but with rows for attack, defense, etc}
as for selecting a certain creature I am sure you could transfer their choice throught the url with a $_GET (I am on my ipod or else I would type it out for you :))
Post Reply

Return to “Coding”