Good morning
I have a form with the controls in the insert statment below. table1 has an Auto increment primary key hence is omitted in the insert statment and form. Am getting the error It didnt work " .mysql_insert_id(); and not any other php or mysql error to tell me if anything is wrong the insert statment.
To top it up, I have an echo statment of the insert statment before it executes, when I copy and paste the insert statment from the browser and paste it in MySQL query analyser, the insert statment actually works. What could be wrong, please help
$Sql= "insert into table1(leader,SnrOp,Op1,Op2,Absent,OP3,ExtraOp,Dat e,Autho) values(".$_POST['sleader'].",".$_POST['SnrOp'].",".$_POST['Op1'].",".$_POST['Op2'].",".$_POST['otOp1'].",".$_POST['extOp'].",".$mydate.",".$_SESSION['absent_status'].")";
$result = mysql_query($Sql);
if (mysql_query($result)){
echo "<br /> Entered id " .mysql_insert_id();
}else{echo "It didnt work " .mysql_insert_id();
}