
Okay, that apparantly wants to show up two banners :s
PHP Code:<?php
mysql_connect("localhost", "", "") or die(mysql_error()); // Try putting in your username and password
mysql_select_db("") or die(mysql_error()); // Try putting in your database
$query = mysql_query("SELECT * from `ads` WHERE Paid = 'Yes'");
$something = mysql_query("SELECT * from `ads`");
$loldongs = mysql_fetch_array($something);
if($loldongs["Paid"] == "Yes") {
while($data = mysql_fetch_array($query)) {
echo "<img src=\"". $data["bannerurl"] ."\" /><br /><!-- I imagine that you wanted a breakspace -->";
echo $data["Site"];
}
else {
echo "<!-- how private.. --><img src=\"URLTOTHABANNER\"><br />Some descriptive text?";
}
?>
Last edited by Calon; 24-08-2008 at 12:02 AM.
Last edited by Excellent1; 24-08-2008 at 12:00 AM.
I think mine might work, I'm really tired and a tiny bit drunk so, sorry if it doesn't work.PHP Code:<?php
mysql_connect("localhost", "", "") or die(mysql_error()); // Try putting in your username and password
mysql_select_db("") or die(mysql_error()); // Try putting in your database
$query = mysql_query("SELECT * from `ads` WHERE Paid = 'Yes'");
$something = mysql_query("SELECT * from `ads`");
$loldongs = mysql_fetch_array($something);
if($loldongs["Paid"] == "Yes") {
while($data = mysql_fetch_array($query)) {
echo "<img src=\"". $data["bannerurl"] ."\" /><br /><!-- I imagine that you wanted a breakspace -->";
echo $data["Site"];
}
else {
echo "<img src=\"URLTOTHABANNER\"><br />Some descriptive text?";
}
?>
thank you both, i just had to change a few of the names and it worked
:]
I wanted a script which would display a certain banner if Paid = Yes, if not it would display an alternative banner, and even though he may have been drunk it worked perfectly
Want to hide these adverts? Register an account for free!