At current I managed to get a form on a wordpress page to submit data to a mysql database (a very large victory for me; not big into php/coding)
This is the code I have been using, but need help changing:
<form method="post">
Value1: <input type="text" name="field1" />
Value2: <input type="text" name="field2" />
Value3: <input type="text" name="field3" />
Value4: <input type="text" name="field4" />
Value5: <input type="text" name="field5" />
<input type="submit" /></form>
$newdb = new wpdb( 'username', 'password', 'database', 'localhost' );
$field1 = $_POST['field1'];
$field2 = $_POST['field2'];
$field3 = $_POST['field3'];
$field4 = $_POST['field4'];
$field5 = $_POST['field5'];
$newdb->insert("test", array(
"field1" => $field1,
"field2" => $field2,
"field3" => $field3,
"field4" => $field4,
"field5" => $field5
));
As you can see, this causes all the inputs on the page to be submitted, and ends up creating blank cells in my table rows when there is no data inserted into the fields.
I need to be able to submit each input separately, hopefully without creating a seperate php script for each input, and without entering blank cells in my table.