ok I am not sure what is wrong with the code I just wrote. Will someone take a look at it for me. What I am trying to do is open MySQL table and order it by the votes feild (higher# at the top) then I want to print the top five like this
<a href=" (the site url from the sites_url feild"><img src"(the link the is under the sites_banner)"></a>
I tried to make the code but I am still learning. can someone help me?
<?php
$dbh=mysql_connect ("localhost", "???????", "?????") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("wirednig_topsites");
$sql = "SELECT site_url, site_banner
FROM " . mtl_sites . "
ORDER BY votes";
$bannerA = "$sql[1]'site_banner'";
$urlA = "$sql[1]";
$topA = '<a href="'.$urlA.'"><img border=0 src='.$bannerA.'></a>';
echo $topA;
?>
I know there is only one being printed. But I was just trying to figure it out. will someone help please. Thanks In advanced.