PHP Code:
<?php if (is_front_page(){ ?>
<?php
//declare the variables
$database='mydb';
$dbserver='myhost';
$user='myuser';
$password='mypass';
//create SQL connection
mysql_connect($dbserver,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM $database.companies where support='Support' order by support desc";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<html>
<head>
<link rel="stylesheet" href="./css/custom/style.css" type="text/css" media="print, projection, screen" />
<link rel="stylesheet" href="./css/jquery.fancybox.css" type="text/css" media="screen" />
<script type="text/javascript" src="./js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="./js/jquery.fancybox.js"></script>
<script type="text/javascript" src="./js/jquery.tablesorter.js"></script>
<script type="text/javascript" src="./js/sorter.js"></script>
<script type="text/javascript" src="./js/jquery.cookie.js"></script>
<script type="text/javascript" src="./js/jquery.tablefilter.js"></script>
<script type="text/javascript" src="./js/filter.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("a.zoom").fancybox();
$("a.non-support").fancybox({
'overlayOpacity' : 0.7,
'overlayColor' : '#000',
'frameWidth' : 900,
'frameHeight' : 600,
'hideOnContentClick': false
});
$("a.submit").fancybox({
'overlayOpacity' : 0.7,
'overlayColor' : '#000',
'padding' : '2',
'hideOnContentClick': false
});
});
</script>
</head>
<body>
<table border="0">
<!-- Table for the results -->
<tr>
<td valign="top">
<table class="tablesorter" id="companies" border="0" cellspacing="1" cellpadding="0">
<thead>
<tr>
<th><font face="Arial, Helvetica, sans-serif">Business</font></th>
<th filter-type='ddl'><font face="Arial, Helvetica, sans-serif">City</font></th>
<th filter-type='ddl'><font face="Arial, Helvetica, sans-serif">State</font></th>
<th><font face="Arial, Helvetica, sans-serif">Address</font></th>
<th><font face="Arial, Helvetica, sans-serif">Website</font></th>
<th filter-type='ddl'><font face="Arial, Helvetica, sans-serif">Category</font></th>
<th><font face="Arial, Helvetica, sans-serif">Support </font></th>
</tr>
</thead>
<tbody>
<?php
$i=0;
while ($i < $num) {
$business=mysql_result($result,$i,"business");
$city=mysql_result($result,$i,"city");
$state=mysql_result($result,$i,"state");
$address=mysql_result($result,$i,"address");
$website=mysql_result($result,$i,"website");
$category=mysql_result($result,$i,"category");
$support=mysql_result($result,$i,"support");
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><b><?php echo $business; ?></b></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $city; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $state; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $address; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><a href="http://<?php echo $website;?>" target="_blank"><? echo $website; ?></a></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $category; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><b><?php echo $support; ?></b></font></td>
</tr>
<?php
$i++;
}
?>
</tbody>
<?php
echo "</table>";
?>
</td>
</tr>
</table>
<br>
</body>
</html>
<?php } ?>