To sum this up, this table is for race level charts (there are 16 races each with 60 levels)
table: race_level
racelevel_id, race_id, level, mod, vitality, health_point, act_dice, experience
this is my insert statement
if(isset($_POST['submit'])){// handle the form
// Connect to the database.
require_once ('inc/connect.php');
// Query the database.
// The insert condition.
$query = "INSERT INTO race_level (race_id, level, mod, vitality, health_point, act_dice, experience) VALUES ('$race_id', '$level', '$mod', '$vitality', '$health_point', '$act_dice','$experience')";
$result = @mysql_query ($query); // Run the query.
if ($result) { // If it ran OK.
// Send an email, if desired.
echo '<p>Thank you for adding this registration!</p><p><a href=add_race_level.php target=_self>Back</a></p>
';
exit();
} else { // If it did not run OK.
// Send a message to the error log, if desired.
echo '<p>Your information could not be registered due to a system error. We apologize for any inconvenience.</p>';
}
mysql_close(); // Close the database connection.
} // End of the main Submit conditional.
Now I semi get the jest of
INSERT INTO table
(field1, field2)
VALUES
('value1','value2'),
('value3','value4'),
('value5','value6')
by following that example would it be:
$query = "INSERT INTO race_level
(race_id, level, mod, vitality, health_point, act_dice, experience)
VALUES
('$race_id', '$level', '$mod', '$vitality', '$health_point', '$act_dice','$experience'),
('$race_id', '$level', '$mod', '$vitality', '$health_point', '$act_dice','$experience'),
('$race_id', '$level', '$mod', '$vitality', '$health_point', '$act_dice','$experience')
and if so do I have to repeat this 60 times as their are 60 levels for each race and I would like to add each races levels in one go?
Thanks ahead of time for any help or links to help 🙂