I am currently working on a client management system for my Computing Coursework and I've come to the "Client Details" section, which allows staff and admin to view personal information about each client.
I've successfully coded the query and everything else around it, I'm just a but stuck on how to actually output the details of each client in a table.
The table will only contain details about a specific client, and so will contain only two columns and as many rows as many columns in the mysql table, like this:
Name | Mark
Surname | Kent
Address | 55 Street
The table has about 10 columns
etc
Here is my code:
$clientid = $_GET['client'];
$query = "SELECT * FROM client_details INNER JOIN users ON client_details.userID = users.id WHERE userID = $clientid";
$result = mysqli_query($dbcon,$query) or die('Error executing database query');
if (mysqli_num_rows($result) < 1) {
die('Error obtaining client details, no rows found. <a href="' . $_SERVER["HTTP_REFERER"] . '">Go Back</a>');
}
while ($row = mysqli_fetch_array($result)) {
echo $row['firstname'] . '<br />';
echo $row['lastname'] . '<br />';
}
exit();