Hello,
I’ve reached the end of my tether in trying to make this work, so this is the final place I am going in order to get it working.
I have created a number generator in which the user specifies the maximum number and generate rate (Generate rate is the amount of numbers the user wishes to generate). All this information is collected from a form.
The data collected from this form then needs be sent to a MySQL table. The Table automatically generates an individual ID for each record. (Fields: ID, Minimum_Number, Maximum_Number, Genertate_Rate and Numbers).
Minimum number is always 0, so the user is not given the option to change this - its there just in case it is required in the future.
The Genertated numbers are created using a loop, and is then stored in an array.
for ($i = $MINIMUM_NUMBER; $i <= $GENERATE_RATE; $i++) {
$NUMBERS[$i] = rand($MINIMUM_NUMBER, $MAXIMUM_NUMBER);
All the other fields are successfully stored in the database, but Numbers will not.
echo "<br />Contents of array:<br />"; //Testing reasons - ensure this is removed later on!
print_r($NUMBERS);
$ID = $_POST['ID'];
$MINIMUM_NUMBER = $_POST['MINIMUM_NUMBER'];
$MAXIMUM_NUMBER = $_POST['MAXIMUM_NUMBER'];
$GENERATE_RATE = $_POST['GENERATE_RATE'];
$NUMBERS = $_POST['NUMBERS'];
$db1 = new Number_Information();
$db1->openDB();
$numofrows = $db1->insert_GeneratedNumber('', $MINIMUM_NUMBER, $MAXIMUM_NUMBER, $GENERATE_RATE, $NUMBERS);
echo "Success. Number of rows affected: <strong>$numofrows<strong>";
$db1->closeDB();
?>
Please excuse me for not following the correct naming conventions, and anyone that helps me will be bathed in eternal glory!