Got a small problem. This is what I want to do:
1. I want to pick out all data from the table TMPBILD
2. Want to put all the data to table BILD
3. Then I want to delete the data in TMPBILD
this is part of the php-code:
// pick out all data from the table TMPBILD
$result=MYSQL_QUERY("SELECT bin_data,filtyp FROM tmpbild WHERE bildindex='$bildtmpindex'");
$row=mysql_fetch_array($result);
$databild = $row["bin_data"];
$datafiltyp = $row["filtyp"];
// put all the data to table BILD
$result=MYSQL_QUERY("INSERT INTO bild (bin_data,filtyp) ".
"VALUES ('$databild','$datafiltyp')");
$id= mysql_insert_id();
$bildindex=$id;
// delete the data in TMPBILD
$result=MYSQL_QUERY("DELETE FROM tmpbild WHERE bildindex='$bildtmpindex'");
After I have run the script I see in the database that 1 row has been added to the table BILD, but it is only the autoimcrement column that has been added. There is no "bin_data" or "filtyp" that has been added.
There is also something wrong with the DELETE syntax (I have no clue why), because the row in table TMPBILD is not deletet.