So add a link into your display code.
Its the same method you used for <a href=“edit.php?id=” . $post[‘id’] . “”>Edit
If you have an ID for each database entry use that, or use the Model.
<a href='printers.php?ID=$post[‘id’] or <a href=‘printers.php?ID=$post[‘Model’]
where printers.php is the page you want to show the individual printer information.
[php]function getPrinters() {
$query = mysql_query(“SELECT * FROM printers”) or die (mysql_error());
if (mysql_num_rows($query) == 0) {
echo “
<td colspan=“3”>No Printers Were Found
”;
} else {
while($post = mysql_fetch_assoc($query)) {
echo “
” . $post[‘Brand’] . “ |
<a href='printers.php?ID=” . $post[‘id’] . "’>" . $post[‘Model’] . “ |
” . $post[‘Office’] . “ |
” . $post[‘Location’] . “ |
” . $post[‘IPAddress’] . “ |
” . $post[‘MACAddress’] . “ |
” . $post[‘Ink Order’] . “ |
” . $post[‘Stock’] . “ |
<a href=“delete.php?id=” . $post[‘id’] . “”>Delete <a href=“edit.php?id=” . $post[‘id’] . “”>Edit |
”;
}
}[/php]
Create a new function in your functions page. Add WHERE to your mysql_query because your wanting to only show specific results.
[php]function displayPrinter($ID) {
$query = mysql_query(“SELECT * FROM printers WHERE ID = ‘$ID’”) or die (mysql_error());
if (mysql_num_rows($query) == 0) {
echo “
<td colspan=“3”>No Printers Were Found
”;
} else {
while($post = mysql_fetch_assoc($query)) {
echo “OUTPUT”;
}
}[/php]
On printers.php access the ID with $_GET[‘ID’]
Call to the function sending $_GET[‘ID’]
$function->displayPrinter($_GET[‘ID’]);
Hope you get the method