Jump to content

help with loops and stuff


reportingsjr

Recommended Posts

Okay, right now Im trying to create and online text based game. Im having this issue though:I have and inventory slot and the user can put items in it.. but its stored in a MySQL database. I would like it to be 4 columns wide and 7 rows long (there are 28 'slots'). I cant figure it out but here is the coding I have so far.. Its way wrong lol.

if(mysql_num_rows($result)>0){echo "<table>";for ($col = 1; $col < 5; $col++) {if($col<5){echo "<tr>";echo "<td>" . $row[' . "</td>";echo "";echo "";echo "</tr>";}echo "</table>";}

Im sure this isnt too hard and im just be ignorant but now I have to go to bed. Thanks for looking!

Link to comment
Share on other sites

Thank you for the compliment :)Well, tell me, what exactly is wrong with the code right now? You PMed me that there was still an issue.. Could you post the final full code that had my table code inserted? (Please use a codebox instead of code or quote):)

Link to comment
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...