OK, here's my problem - the values in this for loop are positively there in each loop (had echo on to test) - but PHP (or mysql) refuses to insert anything after the first loop.
$pkgresult = mysql_query("select from packages order by pkg_name");
if (!$result)
echo "<br>could not fetch the packages and their prices.";
else
{
for ($count = 0; $count < 5; $count++)
{
$row = mysql_fetch_row($pkgresult);
$item = $row[0];
$pkgvar = $row[5];
if ($pkgvar == "fxtra")
$price = $row[1] $howmany;
else
$price = $row[1];
if ($item = substr($$pkgvar,0))
{
$result = mysql_query("insert into contract_items (contr_num, merch_id, contr_yr, contr_mo, contr_day, contr_item, item_price, rep_id) values ('$contrnum', '$merchid', '$year', '$month', '$day', '$item', '$price', '$repid') ");
if ($inserter)
echo "<br>updated ok.";
else
echo "<br>uhoh! - did not update! substr($$pkgvar,0)";
}
}
}
So, can anyone out there tell me what is wrong here? Thanks.
Turkey