yesterday i made this code and it worked like a charm, today it doesn't, is this possible? i didn't touched it.
it only transfers the last row to the other table and yesterday it tranfered all rows selected:
<?php
/* Open your mysql database */
$ligação=mysql_connect($NOME_SERVIDOR, $USER, $PASSWORD);
if (!$ligação) {
echo "Problemas na ligação ao servidor MySQL";
}
$sql = "select * from site";
$resultado = mysql_db_query ($NOME_BD, $sql);
$assign_name = $_POST['assign_name']; /* This gives an array of all the check boxes that were actually selected the value of each entry will be the record id */
foreach($assign_name as $id) /* Cycle through */
$set = mysql_query("Select id from site where id=$id"); /* First need the current vote count */
$rec = mysql_fetch_array($set);
$sel = $rec['id']; /* Increment the vote count */
$passagem = mysql_query("INSERT INTO sites(name, url, email) SELECT c.site_name, c.site_url, c.notif_email FROM site c where id=$id"); /* And update */
if ($passagem) {
mysql_query("DELETE FROM site");
}
if ($resultado) {
echo "Thank you for Submiting!<br><br>The sites you selected were transfered to the final voting fase and all sites submited were deleted";
}
mysql_free_result ($resultado);
?>
thanks in advance