I’m struggling to see the problem at $sql->bind_param(‘i’, $memberid) as I have tried multiple ways to change it…I dont know the problem, also Dataofbirth is actually a typo I made in my database but I kept it.
<?php
// attempt to connect to the DB
$dbconn = mysqli_connect("localhost", "root", "", "gamerental");
if ($dbconn->connect_error > 0) {
die('Could not connect: ' . $dbconn->connect_error);
exit();
}
$memberid = 0;
if (isset($_GET['memberid']))
$memberid = $_GET['memberid'];
if ($memberid == 0)
{
$redirect = "location: http://localhost/gamerental/customers";
header($redirect);
}
$sql = $dbconn->prepare("SELECT MemberID as memberid,
Title as title,
Forename as forename,
Surname as surname,
Address1 as address1,
Address2 as address2,
Postcode as postcode,
Telephone as telephone,
Email as email,
DataOfBirth as dateofbirth,
Gender as gender,
where MemberID = ?");
$sql->bind_param('i', $memberid);
// execute the query
$sql->execute();
// we have the data, bind the fields
$sql->bind_result($memberid, $title, $forename, $surname, $address1, $address2, $postcode, $telephone, $email, $dateofbirth, $gender);
$sql->store_result();
$sql->fetch();
//close connection
mysqli_close($dbconn);
?>