Open RichardLliu opened 4 years ago
The query is always wrong. `require('db.php'); if ($_POST['submit']) { $id = $_POST['ticket_pid']; $routeid = $_POST['route_id']; $level = $_POST['level']; $price = $_POST['price']; $capacity = $_POST['capacity']; $type = $_POST['type'];
// 2. Do a query $query = "Ticket_price SET "; $query .= "route_id = '$routeid', "; $query .= "level = '$level', "; $query .= "price = '$price' "; $query .= "capacity = '$capacity' "; $query .= "type = '$type' "; $query .= "WHERE ticket_pid = $id"; //echo $query; $result = mysqli_query($connection, $query); header('Location: Ticket_price.php');
}
$updateid = $_GET['ticket_pid'];
// 2. Do a query $query = "SELECT ticket_pid, route_id, level, price, capacity, type "; $query .= "FROM Ticket_price "; $query .= "WHERE ticket_pid = $updateid";
$result = mysqli_query($connection, $query);
//echo $query;
if (!$result) { die("query is wrong"); } `
The query is now correct.
It could have been the data.
You can try it again now
You can make changes and upload again.
The query is always wrong. `require('db.php'); if ($_POST['submit']) { $id = $_POST['ticket_pid']; $routeid = $_POST['route_id']; $level = $_POST['level']; $price = $_POST['price']; $capacity = $_POST['capacity']; $type = $_POST['type'];
}
$updateid = $_GET['ticket_pid'];
// 2. Do a query $query = "SELECT ticket_pid, route_id, level, price, capacity, type "; $query .= "FROM Ticket_price "; $query .= "WHERE ticket_pid = $updateid";
$result = mysqli_query($connection, $query);
//echo $query;
if (!$result) { die("query is wrong"); } `