Hi, This code should show all the rows in the table, but it only shows 1, any help?
<?php require_once('../Connections/company.php'); ?><?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "index.php?error=failed";
if (!((isset($SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $SESSION['MM_Username'], $SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<!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=iso-8859-1" />
<title>MyTown - Admin</title>
</head>
<body>
<p>
<?php
mysql_select_db($database_company, $company);
$query = "SELECT * FROM company_details ORDER BY county ASC";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
echo "<table width=\"1500\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>ID:</td>
<td>User Name:</td>
<td>Password:</td>
<td>Name:</td>
<td>Address 1: </td>
<td>Address 2: </td>
<td>Town/City:</td>
<td>County:</td>
<td>Phone:</td>
<td>Fax:</td>
<td>Email:</td>
<td>Website:</td>
<td> </td>
<td> </td>
</tr>";
echo "<tr>";
echo "<td>";
echo $row['id'];
echo "</td>";
echo"<td>";
echo $row['user'];
echo"</td>";
echo"<td>";
echo $row['pass'];
echo"</td>";
echo"<td>";
echo $row['name'];
echo"</td>";
echo"<td>";
echo $row['address1'];
echo"</td>";
echo"<td>";
echo $row['address2'];
echo"</td>";
echo"<td>";
echo $row['towncity'];
echo"</td>";
echo"<td>";
echo $row['county'];
echo"</td>";
echo"<td>";
echo $row['phone'];
echo"</td>";
echo"<td>";
echo $row['fax'];
echo"</td>";
echo"<td>";
echo $row['email'];
echo"</td>";
echo"<td>";
echo $row['website'];
echo"</td>";
$comp = $row['id'];
echo"<td><a href=\"editcompany2.php?comp=$comp\">
<input name=\"Edit\" type=\"submit\" id=\"Edit\" value=\"Edit\" />
</a>
</td>
<td>
<a href=\"deletecomp.php?id=$comp\">
<input name=\"Delete\" type=\"submit\" id=\"Delete\" value=\"Delete\" /></a>
</td>";
echo "</tr>";
echo "</table>";
?>
<p> </p>
</body>
</html>