Hi There,
hoping someone can assist here... i have a list of records where i can Add, Update, Delete all working. I am trying to add a button next to the delete button where the function of it is that once clicked it updates the information in status column.
the field when populated holds a confrmation code and then when the button is clicked i want it to update the information to show "paid" or "confirmed".
so far i have the below but i can't get any variation of it to work.
PHP Code:
<?php
require 'database.php';
$id = null;
if ( !empty($_GET['id'])) {
$id = $_REQUEST['id'];
}
if ( !empty($_POST)) {
// keep track post values
$id = $_POST['id'];
// confirm data
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "UPDATE registrant_test SET paid = 'confirmed' WHERE id = id";
$q = $pdo->prepare($sql);
$q->execute(array($id));
Database::disconnect();
header("Location: index.php");
}
?>
CodingForums...
ما را در سایت CodingForums دنبال می کنید
برچسب : نویسنده : codingforums بازدید : 192 تاريخ : پنجشنبه 30 آذر 1396 ساعت: 23:15