I have the following code:
Code: <?php
$display_block .= "<input type=button value="Generate Random Monster">";
$get_monsters = "select * from monsters1";
$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>";
}
?>
And what I want to do is when they click the button (Generate Random Monster), that it displays a random record from the table. All I want the user to see is the "monster_name". Can anyone tell me how to make the button show a random record from the table in my database? I also would like the table information to be invisible to the user until they click the button. How can I do that?
[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.If the program exits normally the port closes fine, however, if it crashes sometimes it remains open and I am unable to close it. The next time
When i am Canseling the Billing Document in VF11 I am getting Shortdump
Hi Experts
Help =( !! Upload Pics [PHP script]
HelloI need help with a php script [MULTIPLE UPLOAD IMAGES] , where I want to add a feature (watermark the uploaded pictures) , thats mean its watermark & upload in the same time . look this
php calculate
this code echoes correctly the sum but the inserted result is 0??Code:
Display last record first.
I need some help how put the last record first and first record last.ThanksCode: <?phpinclude("connect.php");$query="SELECT * FROM MyNotes ";$result=mysql_query($query);$num
comparing tables across databases sql refinement ideas required
Hi all
Insert to MySQL inside foreach
Hey.I am parsing some html, and putting inside an html db.I need to create a randomized integer to be a unique identifier, and i chose just to use time().But I foreach the results, and inside here i
browse folder only
hi,is there a way i can browse or get the directory or folder only and not the file?i just want to browse the directory and get the files from it.
trim function issues
Hi guys, total noob here... So I've been tinkering around with a html and am using php to email the subitted data to me. It's all working fine, except now I've changed the rules of the form a little
php libs/ browsercap.in
ok i have a host that refuses to stay current. they control my php settings and libs. is there a way to put the browsercap.ini in my root directory and point to it so that i may use the get_browser