reportingsjr Posted May 26, 2006 Share Posted May 26, 2006 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 More sharing options...
Jack McKalling Posted May 26, 2006 Share Posted May 26, 2006 echo "<table><tbody>";for ($r=0; $r<7; $r++){ echo "\r\n<tr>";for ($c=0; $c<4; $c++){ echo "\r\n<td>" . ??? . "</td>"; }echo "</tr>";} echo "</tbody></table>"; Link to comment Share on other sites More sharing options...
reportingsjr Posted May 26, 2006 Author Share Posted May 26, 2006 wow, dan! you are awesome.. I swear, you and scott have solved every single problem thing for my game so far Link to comment Share on other sites More sharing options...
Jack McKalling Posted May 28, 2006 Share Posted May 28, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now