I have created a page where the user searches for records after typing a keyword in a textbox and clicks on a button. However I am getting an error saying "Division by zero in C:\wamp\www\admin-rights-display.php on line 77" and "Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\admin-rights-display.php on line 93". I dont know what to do. Here are my codes:
<?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?>
<!doctype html>
<!--
<!--
<!--
<!--
<html class="no-js" lang="en">
<!--
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Community Night Cycling 2014 Singapore</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0,user-scalable = no">
<meta name="googlebot" content="index, follow" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
<link rel="stylesheet" href="style/general.css" />
<link rel="stylesheet" href="style/framework.css" />
<link rel="stylesheet" href="style/site.css" />
<script src="js/modernizr-2.0.6.min.js" type="text/javascript"></script>
</head>
<body class="contact">
<div class="mother">
<header class="mast-head stack-fixed clearfix">
<article class="logo">
<a href="index.html"></a>
</article>
<nav class="main-nav">
<ul>
<li class="first">
<a href="home.html">Home</a>
</li>
<li>
<a href="register.html">Registration</a>
</li>
<li>
<a class="selected" href="admin.html">Administrator Page</a>
</li>
<li class="last">
<a href="stats.html">Statistics</a>
</li>
</ul>
</nav><!--
</header>
<article class="main" role="main">
<section class="stack-fixed clearfix entry-text">
<div class="top-mast contact-top-mast">
</div>
<div class="row">
<div class="slat-8">
<div id="fields">
$Search = $_POST['Search'];
if ($Search == "ALL")
{
$result = mysql_query("SELECT Name, Gender, Age, Email, Occupation, NRIC, Address, ZipCode FROM members ",$connection);
}
else
{
$result = mysql_query("SELECT Name, Gender, Age, Email, Occupation, NRIC, Address, ZipCode FROM members WHERE Address LIKE '.$Search."%"'",$connection);
}
echo "<table border="1">
<tr>
<th>Name</th>
<th>Gender</th>
<th>Age</th>
<th>Email</th>
<th>Occupation</th>
<th>NRIC</th>
<th>Address</th>
<th>ZipCode</th>
</tr>";
while($row=mysql_fetch_array($result))
{
echo"<tr>";
echo"<td".$row['name'].">";
echo"<td".$row['gender'].">";
echo"<td".$row['age'].">";
echo"<td".$row['email'].">";
echo"<td".$row['occupation'].">";
echo"<td".$row['nric'].">";
echo"<td".$row['address'].">";
echo"<td".$row['zipcode'].">";
echo "</tr>";
}
echo "</table>";
mysql_close($connection);
?>
</div>
</div>
</div>
</section>
<section class="stack-fixed entry-text footer clearfix">
<ul class="slat-7 first">
</ul>
<ul class="slat-3">
<li><i class="icon-envelope"></i> <a href="#">awesome@egrappler.com</a></li>
<li><i class="icon-retweet"></i> <a href="https://twitter.com/charitycycle13">Connect on Twitter</a></li>
<li><i class="icon-share-alt"></i> <a href="https://www.facebook.com/WondersOfTheWorldCharityCycle">Share With Your Friends</a></li>
<li><i class="icon-question-sign"></i> Help</li>
</ul>
<ul class="slat-2 last">
<li><a href="home.html">Home</a></li>
<li><a href="register.html">Registration</a></li>
<li><a href="admin.html">Administrator Page</a></li>
<li><a href="stats.html">Statistics</a></li>
</ul>
</section>
</article>
</div>
<!--
<script src="js/jquery.min.js" type="text/javascript"></script>
<script defer src="js/accessories-min.js" type="text/javascript"></script>
<script defer src="js/site.js" type="text/javascript"></script>
<!--
</body>
</html><?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?>
<!doctype html>
<!--
<!--
<!--
<!--
<html class="no-js" lang="en">
<!--
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Community Night Cycling 2014 Singapore</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0,user-scalable = no">
<meta name="googlebot" content="index, follow" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
<link rel="stylesheet" href="style/general.css" />
<link rel="stylesheet" href="style/framework.css" />
<link rel="stylesheet" href="style/site.css" />
<script src="js/modernizr-2.0.6.min.js" type="text/javascript"></script>
</head>
<body class="contact">
<div class="mother">
<header class="mast-head stack-fixed clearfix">
<article class="logo">
<a href="index.html"></a>
</article>
<nav class="main-nav">
<ul>
<li class="first">
<a href="home.html">Home</a>
</li>
<li>
<a href="register.html">Registration</a>
</li>
<li>
<a class="selected" href="admin.html">Administrator Page</a>
</li>
<li class="last">
<a href="stats.html">Statistics</a>
</li>
</ul>
</nav><!--
</header>
<article class="main" role="main">
<section class="stack-fixed clearfix entry-text">
<div class="top-mast contact-top-mast">
</div>
<div class="row">
<div class="slat-8">
<div id="fields">
$Search = $_POST['Search'];
if ($Search == "ALL")
{
$result = mysql_query("SELECT Name, Gender, Age, Email, Occupation, NRIC, Address, ZipCode FROM members ",$connection);
}
else
{
$result = mysql_query("SELECT Name, Gender, Age, Email, Occupation, NRIC, Address, ZipCode FROM members WHERE Address LIKE '.$Search."%"'",$connection);
}
echo "<table border="1">
<tr>
<th>Name</th>
<th>Gender</th>
<th>Age</th>
<th>Email</th>
<th>Occupation</th>
<th>NRIC</th>
<th>Address</th>
<th>ZipCode</th>
</tr>";
while($row=mysql_fetch_array($result))
{
echo"<tr>";
echo"<td".$row['name'].">";
echo"<td".$row['gender'].">";
echo"<td".$row['age'].">";
echo"<td".$row['email'].">";
echo"<td".$row['occupation'].">";
echo"<td".$row['nric'].">";
echo"<td".$row['address'].">";
echo"<td".$row['zipcode'].">";
echo "</tr>";
}
echo "</table>";
mysql_close($connection);
?>
</div>
</div>
</div>
</section>
<section class="stack-fixed entry-text footer clearfix">
<ul class="slat-7 first">
</ul>
<ul class="slat-3">
<li><i class="icon-envelope"></i> <a href="#">awesome@egrappler.com</a></li>
<li><i class="icon-retweet"></i> <a href="https://twitter.com/charitycycle13">Connect on Twitter</a></li>
<li><i class="icon-share-alt"></i> <a href="https://www.facebook.com/WondersOfTheWorldCharityCycle">Share With Your Friends</a></li>
<li><i class="icon-question-sign"></i> Help</li>
</ul>
<ul class="slat-2 last">
<li><a href="home.html">Home</a></li>
<li><a href="register.html">Registration</a></li>
<li><a href="admin.html">Administrator Page</a></li>
<li><a href="stats.html">Statistics</a></li>
</ul>
</section>
</article>
</div>
<!--
<script src="js/jquery.min.js" type="text/javascript"></script>
<script defer src="js/accessories-min.js" type="text/javascript"></script>
<script defer src="js/site.js" type="text/javascript"></script>
<!--
</body>
</html>