Hello,
Trying to insert data into a table and at the same time deleting data from the old table isn't working.
The problem:
Inserting data is functioning BUT the delete command isn't working.
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