19 lines
555 B
PHP
19 lines
555 B
PHP
<?php
|
|
include_once 'config/pdo_connect.php';
|
|
/** @var PDO $pdo */
|
|
|
|
if (isset($_GET['id'])) {
|
|
try {
|
|
$id = $_GET['id'];
|
|
$statement = $pdo->prepare('delete from tb_pdo_mysqls where id = :id');
|
|
$statement->bindParam(':id', $id);
|
|
$statement->execute();
|
|
if ($statement->errorCode() == 0) {
|
|
echo '<script>alert("delete success");location.href="19.test1.php"</script>';
|
|
}
|
|
} catch (PDOException $e) {
|
|
echo 'Error: ' . $e->getMessage();
|
|
// print_r($statement->errorInfo());
|
|
}
|
|
|
|
} |