I have 5 variable that are passed to this page and I want to loop to each var and check its value and if it is not = to none write it to the table. My problem is all I am doing with this code is setting $thisitem to item1,item2,item3,item4 and item5 not the actual values of $item1, $item2,..... I hope this makes sense
for ($i=1; $i<=5; $i++)
{
$thisitem = "item$i";
echo $$thisitem.'<br>';
if ($$thisitem <> "none")
{
$prep = ibase_prepare("INSERT INTO ICCATALOGMATES(FCAPTION, FMATECAT, FMATENAME)
VALUES (?,?,?)" );
$query = ibase_execute($prep,$$thisitem,$cat,$$thisitem);
}