Hi All,
I am trying to figure out how to get the index of my POST data to start with 1 instead of 0. Reason being, is I am relating a series of tables, and of course the table all auto-increment starting with ID 1 and it is throwing me off on this one set of data starting with 0.
Here is my loop for the $_POST['Product'] array (and the index I want to change to start with 1 is $ProductID):
foreach ($_POST['Product'] as $ProductID => $classesArray)
{
foreach ($classesArray as $ClassID)
{
//insert ratings data into MySQL
$sql ="insert into classes";
$sql .="(BallotID, ProductID, ClassID, Date)";
$sql .="values('$BallotID', '$ProductID', '$ClassID', '$Date')";
if(!mysql_query($sql))
{
echo 'insert into classes error<br><br>' .
mysql_errno().'<br>'.mysql_error().'<br><br>';
}
{
{
As always, I appreciate the help and advice,
Don
[edit: Post-500, for what its worth. <grin>]