Try this and see what happens:
<?php
if(isset($_POST['empfullname']) && isset($_POST['empmidname']) &&
isset($_POST['empbdate']) && isset($_POST['emptitle']) &&
isset($_POST['departement']))
{
$empfullname = $_POST['empfullname'];
$empmidname = $_POST['empmidname'];
$empbdate = $_POST['empbdate'];
$empjobtitle = $_POST['emptitle'];
$empdepartement = $_POST['departement'];
//Connect to DB
//Change the Fields in this query
$iqry_employees = mysql_query("INSERT INTO employess
(FIELD1,FIELD2,FIELD3,FIELD4,FIELD5) VALUES ('','" . $empfullname . "','" .
$empmidname . "','" . $empbdate . "','" . $empjobtitle . "','" .
$empdepartement . "','','')");
if(!$iqry_employees)
die("Unable To Insert Into Employees Due To An Error");
//Close DB
}
?>
"Ronald Rahal" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Why this code is inserting twice in the database ?
>
>
>
>
> <?php
> if ( (isset($_POST['empfullname'])) && (isset($_POST['empmidname']))
> && (isset($_POST['empbdate']))
> && (isset($_POST['emptitle']))&& (isset($_POST['departement'])) )
> {
> $empfullname=$HTTP_POST_VARS['empfullname'];
> $empmidname=$HTTP_POST_VARS['empmidname'];
> $empbdate=$HTTP_POST_VARS['empbdate'];
> $empjobtitle=$HTTP_POST_VARS['emptitle'];
> $empdepartement=$HTTP_POST_VARS['departement'];
>
> $insert="insert into employee values
> ('','$empfullname','$empmidname','$empbdate','$empjobtitle','$empdeparte
> ment','','')";
> $exec=mysql_query($insert);
> if(!$exec)
> die("Unable To Insert Into Employees Due To An
> Error");
>
> }
>
> ?>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php