- Joined
- Mar 28, 2022
- Posts
- 975
- Solutions
- 7
- Reaction
- 5,893
- Points
- 1,225
Magandang araw mga paps. Patulong sana. Ano po ba dapat ibang approach sa pag archive. Yung mag delete ako specific data then ma insert ito sa archive table. Ito kasing code ko ma archive siya kaso ma delete all po siya, sana may maka tulong po. Salamat.
<?php
require_once 'db_connect.php';
$query = mysqli_query($conn, "SELECT * FROM
while ($fetch = mysqli_fetch_array($query)) {
// Archive the record
mysqli_query($conn, "INSERT INTO
// Delete the record from the 'product' table
mysqli_query($conn, "DELETE FROM
if($fetch)
{
echo '<script> alert("Data Deleted"); </script>';
header("Location:home_page_atty.php");
}
else
{
echo '<script> alert("Data Not Deleted"); </script>';
}
}
?>
<?php
require_once 'db_connect.php';
$query = mysqli_query($conn, "SELECT * FROM
atty_info
");while ($fetch = mysqli_fetch_array($query)) {
// Archive the record
mysqli_query($conn, "INSERT INTO
archive
VALUES('', '$fetch[atty_id]', '$fetch[name]', '$fetch[gender]', '$fetch[mobile]')") or die(mysqli_error($conn));// Delete the record from the 'product' table
mysqli_query($conn, "DELETE FROM
atty_info
WHERE atty_id
= '$fetch[atty_id]'") or die(mysqli_error($conn));if($fetch)
{
echo '<script> alert("Data Deleted"); </script>';
header("Location:home_page_atty.php");
}
else
{
echo '<script> alert("Data Not Deleted"); </script>';
}
}
?>