HI jgetner, thanks a lot for your fast reply. However, when I tried to use it, it still didn't give anything. When I tried to use print_r, the array is there but there is no data. Is it because I am not getting out from the database? What am I doing wrong? Maybe it helps if I give you the code from my previous page where I need to get the information. I hope you can help me solve this problem. I am stuck just in this page for almost a day now and still can't figure out what is going on. Below is my other page where user can search for the agency and click the hyperlink given to access the whole information from the database.
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_rs83 = 10;
$pageNum_rs83 = 0;
if (isset($_GET['pageNum_rs83'])) {
$pageNum_rs83 = $_GET['pageNum_rs83'];
}
$startRow_rs83 = $pageNum_rs83 * $maxRows_rs83;
$colname_rs83 = "-1";
if (isset($_GET['agencyname'])) {
$colname_rs83 = $_GET['agencyname'];
}
mysql_select_db($databaseconnection, $nameoftable);
$query_rs83 = sprintf("SELECT * FROM jos_agencyname WHERE agencyname LIKE %s", GetSQLValueString("%" . $colname_rs83 . "%", "text"));
$query_limit_rs83 = sprintf("%s LIMIT %d, %d", $query_rs83, $startRow_rs83, $maxRows_rs83);
$rs83 = mysql_query($query_limit_rs83, $Designation) or die(mysql_error());
$row_rs83 = mysql_fetch_assoc($rs83);
if (isset($_GET['totalRows_rs83'])) {
$totalRows_rs83 = $_GET['totalRows_rs83'];
} else {
$all_rs83 = mysql_query($query_rs83);
$totalRows_rs83 = mysql_num_rows($all_rs83);
}
$totalPages_rs83 = ceil($totalRows_rs83/$maxRows_rs83)-1;
$queryString_rs83 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_rs83") == false &&
stristr($param, "totalRows_rs83") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_rs83 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_rs83 = sprintf("&totalRows_rs83=%d%s", $totalRows_rs83, $queryString_rs83);
global $desnum;
global $agencyname;
?>
<form action="getagency.php" method="get" name="frmsearch" style="background-color:#c6d7ff">
<table width="100%" border="0" cellpadding="2" bgcolor="#ffffff" id="search">
<tr>
<td width="24%">Search Agency</td>
<td width="61%"><input name="agencyname" type="text" style="width:250" /></td>
<td width="15%"><input name="Submit" type="submit" value="Search" /></td>
</tr>
</table>
<?php do { ?>
<table width="100%" border="0" cellpadding="2">
<tr>
<td width="16%"><?php echo "<a href='getagency.php?desname=" .$desnum ."'>";?><?php echo $row_rs83['desnum']; ?><?php echo "</a>"; ?> </td>
<td width="79%"><?php echo "<a href='getagency.php?desname=" .$agencyname ."'>";?> <?php echo $row_rs83['agencyname']; ?><?php echo "</a>"; ?></td>
</tr>
</table>
<?php } while ($row_rs83 = mysql_fetch_assoc($rs83)); ?>
<table width="100%" border="0" cellpadding="2">
<tr>
<td width="16%"><?php echo "<a href='getagency.php?desname=".$desnum ."'>";?><?php echo $_SESSION[$row_rs83['desnum']]; ?><?php echo "</a>"; ?> </td>
<td width="79%"><?php echo "<a href='getagency.php?desname=".$agencyname ."'>";?> <?php echo $_SESSION[$row_rs83['agencyname']]; ?><?php echo "</a>"; ?></td>
</tr>
</table>
</form>
<?php
mysql_free_result($rs83);
?>