I am trying to open one page base on id from web address.
My address is …/customer-single.php?id=5
And my code is:
try {
$connection = new PDO($dsn, $username, $password, $options);
$CustomerID = $_GET['CustomerID'];
$sql = "SELECT * FROM tblcustomer WHERE CustomerID = :CustomerID";
$statement = $connection->prepare($sql);
$statement->bindValue(':CustomerID', $CustomerID);
$statement->execute();
$user = $statement->fetch(PDO::FETCH_ASSOC);
} catch(PDOException $error) {
echo $sql . "<br>" . $error->getMessage();
}
So I need to see only result from CustomerID=5.