此状态(活动 1 /非活动 0)按钮使任何单个记录处于活动/非活动状态。 我需要更改它,以便在单击时通过更改 tbladdress_status db 变量使该记录处于活动状态而所有其他记录处于非活动状态。
Scanner input = new Scanner(System.in);
System.out.println("Enter number");
int num = input.nextInt();
System.out.println("Enter Name");
String name = input.next();
System.out.println("Enter Surname");
String surname = input.next();
if (isset($_GET['tbladdress_status'])) {
if ($_GET['tbladdress_status']=="ok") {
$statusupdate=$db->prepare("UPDATE tbl_address SET
tbladdress_status=:tbladdress_status
WHERE tbladdress_id={$_GET['tbladdress_id']}
");
$update=$statusupdate->execute(array(
'tbladdress_status' => $_GET['activestatus']
));
if ($update) {
Header("Location:../../front-address-all.php?status=ok");
} else {
Header("Location:../../front-address-all.php?status=no");
}
}
}