hello,
thanks again, I am having problems with the code, I am getting no results a blank page (even when I view source) I tested it by hiding everything but the connection and it worked. Could u possible help me troubleshoot this.
<?
$db_name = "xxxxxxxx";
$table_name = "business";
$connection = @mysql_connect("xxxxxx", "xxxxxx", "xxxxx") or die("Error1 - ".mysql_error());
$db = @mysql_select_db($db_name, $connection) or die("Error2 - ".mysql_error());
$pagelimit="1";
__$sql=mysql_query("SELECT * FROM $table_name WHERE catID = '$REQUEST[id]' AND active = '1'");
count number of matches
__$totalrows=_mysql_num_rows($sql);
__$pagenums=ceil($totalrows/$pagelimit);
_if($page==''){
___$page='1';
_}
___$start=($page-1)*_$pagelimit;
echo"<b>".$totalrows._" matches found</b><br>\n";
$starting_no=$start+1;
if($totalrows-$start<$pagelimit){
$end_count=$totalrows;
}elseif($totalrows-$start>=$pagelimit){
$end_count=$start+_$pagelimit;
}
echo"Results$starting_no_to_$end_count_shown.<br>\n";
if($totalrows-$end_count>$pagelimit){
$var2=$pagelimit;
}elseif($totalrows-$end_count<=$pagelimit){
$var2=$totalrows-$end_count;
}
$space=_" ";
if($page>1){
_____echo"« <a href='showCategory.php?page=".($page-1)."' class=main>Previous".$space.$pagelimit."</a>".$space.$space."";
__}
_for($i=1;$i<=$pagenums;$i++){
_if($i!=$page){
______echo"<a_href='showCategory.php?page=$i'class=main>$i</a>";<br>
___}
__else{
______echo"<b_class='red'>$i</b>";
__}
_}
_if($page<$pagenums){
__echo"".$space.$space.$space.$space." <a href='showCategory.php?page=".($page+1)."' class=main>Next ".$var2."</a> »";
__}
// $sql = "SELECT * FROM $table_name WHERE catID = '$_REQUEST[id]' AND active = '1' ORDER BY busName ";
$sql = "SELECT * FROM $table_name WHERE catID = '$REQUEST[id]' AND active = '1' ORDER BY busName LIMIT$start,$pagelimit ";
$result = @($sql, $connection) or die("Error3 - ".mysql_error());
while($row = mysql_fetch_array($result)) {
$busID = $row['busID'];
$catID = $row['catID'];
$busName = $row['busName'];
$busEmail = $row['busEmail'];
$busLogo = $row['busLogo'];
$busPhone = $row['busPhone'];
$busUrl = $row['busUrl'];
$contact_list .= "<tr><td width='150' align='center' rowspan='2'>";
if($busLogo != "") { $contact_list .= "<img src='logo/$busLogo'>";}
$contact_list .= "</td>";
$contact_list .= "<td colspan='2' valign='top'><b>$busName</b></td></tr><tr>";
$contact_list .= "<td valign='top'><b>Email: </b><a href='mailto:$busEmail' class='buttons'>$busEmail</a><br><b>Tel: </b> $busPhone<br></td><td valign='top'>";
if($busUrl != "") { $contact_list .= "<b>Website : </b><a href='http://www.$busUrl' class='buttons' target='blank'>$busUrl</a> <br>";}
$contact_list .= "<a href='businessDetails.php?id=$busID' class='buttons'>More Details.....</a></td></tr>";
$contact_list .= "<tr><td colspan='3'><hr width='75%' color='#cccccc'></td></tr>";
} // end while
?>
<? include ("headerTop.php"); ?>
<? include ("buttons.php"); ?>
<table width="100%" height="381" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="150" valign="top">
<? include ("sideButtons.php"); ?>
</td>
<td height="381" align="center" valign="top"> <div align="center"><img src="images/viewBusiness.gif" width="400" height="37">
</div>
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<? echo "$contact_list" ?>
</table>
</td>
<td width="150" height="381" valign="top">
<? include ("advertisments.php"); ?></td>
</tr>
</table>
<table width="100%" height="70" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><? include ("footer.php"); ?></td>
</tr>
</table>
</body>
</html>