Hello,
The objective:
Trying to insert data (sent to the temporary table from online form) into a final table and at the same time deleting data from the old temporary table.
The problem:
Inserting data from editing is functioning BUT the DELETE command isn't working, since when the update button is pressed, the data remains in the temporary table.
Any help here would be great.
Thanks in advance !
Query I'm using:
<? include('includes/dbase.php');
if(isset($submit)){
$ID=mysql_insert_id();
//Insere dados na tabela de empreendimentos
$sql ="INSERT INTO table(ID, empr, email, www, notes_cr) VALUES(null, '$empr', '$email', '$www', '$notes_cr')";
$result=mysql_query($sql) or die("INSERT: ".mysql_error());
//Apagar registo da tabela temporária de empreendimentos
$sql="DELETE FROM temp_TABLE WHERE ID=$ID";
$result=mysql_query($sql) or die("DELETE: ".mysql_error());
GET TEMP_TABLE
$sql="SELECT * FROM temp_table where ID=$ID";
$result=mysql_query($sql) or die("GET TABLE: ".mysql_error());
while ($fields=mysql_fetch_array($result)){
$empr=$fields["empr"];
$email=$fields["email"];
$www=$fields["www"];
$notes_cr=$fields["notes_cr"];
}
?>
HTML GOES HERE