Hey all,
i am trying to find a way to exclude certain results from my query.
here is what i have so far
<?
$username = "xxxx";
$password = "xxxx";
$host = "xxxx";
$database = "xxxx";
$table = "xxxx";
mysql_connect($host,$username,$password) or die("Cannot connect to the database.<br>" . mysql_error());
mysql_select_db($database) or die("Cannot select the database.<br>" . mysql_error());
if(!isset($page)) {
$page = 0; // leave this as is
}
$limit = 1; // defines how many entries per page
$sql = "SELECT * FROM $table ORDER BY RAND() DESC LIMIT $page,$limit";
$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());
while($result = mysql_fetch_array($query)) {
$Field = $result["Image"]; // extract all your fields here like normal
$Field2 = $result["Url"]; // extract all your fields here like normal
$Field3 = $result["Alt"]; // extract all your fields here like normal
echo "<a href=\"$Field2\"><img src=\"$Field\" alt=\"$Field3\" width=\"315\" height=\"304\" class=\"picborder\" /></a>";
}
?>
now some of the results have 0 as the url and these are the ones i want to remove from the results so basically all the ones with a full url will show but not the ones with 0
Thanks in advance peeps.
I know i am missing a simple trick here which makes me kinda angry