Here is the PHP:
// check to see if the user has hit the roll button yet if( isset( $_POST['yep'] )) { // looks like they have, lets make an array of rolls with random numbers 1 to 100. $roll = array(); for( $a = 1; $a < 13; $a++ ) { $roll[$a] = rand( 1, 100); } // great, now it's just a matter of retrieving the correlating character attributes from the database // calling a page that stores database connection info include 'database.php'; // writing our SQL selection statement $query = "SELECT roll1.Height, roll2.Body_Type, roll3.Eye_Color, roll4.Physical_Characteristic, roll5.Physical_Characteristic2, roll6.Physical_Characteristic3, roll7.Disposition, roll8.Phobia_Philia, roll9.Phobia_Philia2, roll10.Origin_Childhood, roll11.Siblings, roll12.Motivation_For_Adventuring FROM roll1, roll2, roll3, roll4, roll5, roll6, roll7, roll8, roll9, roll10, roll11, roll12 WHERE roll1.id = '".$roll[1]."' AND roll2.id = '".$roll[2]."' AND roll3.id = '".$roll[3]."' AND roll4.id = '".$roll[4]."' AND roll5.id = '".$roll[5]."' AND roll6.id = '".$roll[6]."' AND roll7.id = '".$roll[7]."' AND roll8.id = '".$roll[8]."' AND roll9.id = '".$roll[9]."' AND roll10.id = '".$roll[10]."' AND roll11.id = '".$roll[11]."' AND roll12.id = '".$roll[12]."'"; // processing our query, print error statement if it fails $result = mysql_query( $query ) or die( mysql_error()); // pouring all the data into an array called $character, we'll use MYSQL_ASSOC for our associative array keys $character = mysql_fetch_array( $result, MYSQL_ASSOC ); // now let's print our results, we'll start with opening a table echo "| Roll"." ".$rollnum." "." | \n"; echo "".$roll[$rollnum]." | \n"; // now we'll print the character traits echo "".$key." | \n"; echo "".$attribute." | \n"; echo "