12 lines
259 B
PHP
12 lines
259 B
PHP
<?php
|
|
include "db.php";
|
|
|
|
$id=$_POST['id'];
|
|
|
|
$row=mysqli_fetch_assoc(mysqli_query($conn,"SELECT status FROM records WHERE id=$id"));
|
|
|
|
$new = $row['status']=="active"?"inactive":"active";
|
|
|
|
mysqli_query($conn,"UPDATE records SET status='$new' WHERE id=$id");
|
|
?>
|