Forum Moderators: open
I am using PHP 4.7 and i am doing a normal insert, it works fine in FF and Safari, but IE7 always insert 2 records at once!
How could this happen?
here is the part of code where it inserts...
if($_SESSION['edit_ad']!= "")
$sql = "UPDATE `ads` SET `name` = '".$_SESSION["name"]."' ..... where id = '".$_SESSION['edit_ad']."' LIMIT 1";
else
$sql = "INSERT INTO `ads` ( `name` , ......)
VALUES ( '".$_SESSION["name"]."' , ....)";
if(mysql_query($sql))
{
session_write_close();
header("Location: confirm");
exit;
}
Please try to tip me with any solution to this crazy thing!
Thanks in advance.
if($_SESSION['edit_ad']!= "")
$sql = "UPDATE `ads` SET `name` = '".$_SESSION["name"]."' ..... where id = '".$_SESSION['edit_ad']."' LIMIT 1";
else
$sql = "INSERT INTO `ads` ( `name` , ......)
VALUES ( '".$_SESSION["name"]."' , ....)";
It looks like regardless of the condition your script is executed twice (once for each cond)
try
elseif($_SESSION['edit_ad']== "")
{
$sql = "INSERT INTO `ads` ( `name` , ......)
VALUES ( '".$_SESSION["name"]."' , ....)";
}