<?php
$con = mysql_connect("localhost","user","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("spotid", $con);
$query = "SELECT spot_id FROM spot_num ORDER BY spot_id LIMIT 0,1";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
$row[spot_id]+1;
}
$sql="INSERT INTO spot_num (name_id, spot_id)
VALUES
('$_POST[name_id]','$_POST[$row]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo $_POST[name_id],$_POST[$row];
mysql_close($con)
?>
This works up to here "$row[spot_id]+1" everything below that works with the exception "$_POST[$row]" I want to pass the "$row[spot_id]+1" to "$_POST[$row]"
So when someone fills out the form page it will then pass along what they enter on the form page on submit, it will then query the DB for the [spot_id] then increment by 1 then write both the incremented value and the users form information back to the DB.
Help
Thank you