hi everyone :)
i know how to show all the records from database in an html table but how would i show specific category.for example i want to show records only with type T (type T is in database).im new with php and i dont know how to do it properly.thankyou here is my code
<?php include("../includes/config.php"); ?>
<!DOCTYPE HTML>
<html>
<head>
<title>Admdin Home</title>
<link rel="StyleSheet" href="css/style.css" type="text/css" media="screen">
</head>
<body>
<?php include("includes/header.php"); ?>
<?php include("includes/nav.php"); ?>
<?php include("includes/aside.php"); ?>
<div id="maincontent">
<div id="breadcrumbs">
<a href="">Home</a> >
<a href="">Manage Users</a> >
List Users
</div>
<h2>Teachers List</h2>
</div>
<?php
if ($_SESSION["isadmin"])
{
$con=mysql_connect($dbserver,$dbusername,$dbpassword);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($dbname, $con);
$result = mysql_query("SELECT * FROM accounts WHERE (type=='T')");
echo "<table border='1'>
<tr>
<th>E-mail</th>
<th>Firstname</th>
<th>Lastname</th>
<th>Type</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['firstname'] . "</td>";
echo "<td>" . $row['lastname'] . "</td>";
echo "<td>" . $row['type'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
</body>
<?php include("includes/footer.php"); ?>
</html>
<?php
}
else
{
header("Location: ".$fullpath."login/unauthorized.php");
}
?>