Hello
I have a flash form that sends variable with LoadVariables.
It works, no problem there.
But is there something wrong with my php code, because it's not getting inserted into the database, MySQL, and I don't see any php errors in my logs.
<?
require("db.inc.php");
$today = date("F j, Y, g:i a");
$cnt="join";
$type="web";
$i = 0;
if( $promocode == 5455 )
{
for ($i = 1; $i <= 5; $i++) {
$sql = "INSERT INTO contest (age,fname,lname,address,city,state, country, contest, ZipPostal, date, type, question, promo)
VALUES ( '$age', '$fname', '$lname', '$address', '$city', '$stateprov', '$country', '$cnt','$zip', '$today', '$type', '$product', '$promocode')";
}
$result = mysql_query($sql) or die(mysql_error());
}
else
{
$sql = "INSERT INTO contest (age,fname,lname,address,city,state, country, contest, ZipPostal, date, type, question, promo)
VALUES ( '$age', '$fname', '$lname', '$address', '$city', '$stateprov', '$country', '$cnt','$zip', '$today', '$type', '$product', '$promocode')";
$result = mysql_query($sql) or die(mysql_error());
}
?>
As you can see, if they enter a promocode equal to 5455, then their entry goes into the DB 5 times.
Can anyone let me know if something is wrong with my PHP code?
Thank You
MK