twilitegxa Posted January 29, 2010 Share Posted January 29, 2010 I have the following section written in PHP: <?php $display_block .= "<input type=button value=\"Generate Random Monster\">"; $get_monsters = "select * from monsters1 order by rand() limit 1"; $get_monsters_res = mysql_query($get_monsters, $conn) or die(mysql_error()); $display_block .= "<table class=monster>"; while ($monsters_info = mysql_fetch_array($get_monsters_res)) { $monster_id = $monsters_info['id']; $monster_name = $monsters_info['name']; $monster_map = $monsters_info['map']; $monster_location = $monsters_info['location']; $monster_hit_points = $monsters_info['hit_points']; $monster_attack = $monsters_info['attack']; $monster_defense = $monsters_info['defense']; $monster_agility = $monsters_info['agility']; $monster_wisdom = $monsters_info['wisdom']; $monster_magic_endurance = $monsters_info['magic_endurance']; $monster_number_of_attacks = $monsters_info['number_of_attacks']; $monster_range = $monsters_info['range']; $monster_experience_points = $monsters_info['experience_points']; $monster_silver = $monsters_info['silver']; $display_block .= "<tr><td>$monster_name</td>"; } $display_block .= "</tr></table>"; ?> How do I set the table to be invisible until the user clicks the the button? I'd also like the button to run the code that generates the random record from my table. Currently I just have the table displaying the random record. Can anyone help? Quote Link to comment https://forums.phpfreaks.com/topic/190214-make-table-invisible-until-button-is-clicked/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.