I'm working on a webpage that needs to show database content and let you click on them to show more info from the database related to that id or even linking a checkbox next to the content to the same databse id so I can delete the post if needed, my code for showing the content so far work perfectly,
but I just don't have a clue on how I could link the id/info that is related to the id to a checkbox or onclick command
my code so far:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Get our database connector
require("includes/conn.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="css/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="featured">
<h2></h2>
<div>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Grab the data from our people table
$sql = "SELECT * FROM people ORDER BY ID";
$result = mysql_query($sql) or die ("Could not access DB: " . mysql_error());
while ($row = mysql_fetch_assoc($result))
{
echo "<div class=\"picture\">";
echo "<p>";
// Note that we are building our src string using the filename from the database
echo "<img src=\"content/uploads/" . $row['filename'] . "\" alt=\"\" height=\"219\" width=\"350\" /><br />" . "<br />";
echo $row['fname'] . " " . "<br />" . "<br />";
echo "</p>";
echo "</div>";
}
?>
</div>
</div>
</body>
</html>