Create an Ad
Sponsored Ads
'$servedate' ORDER BY RAND() LIMIT 1"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); // if records present if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_object($result)) { $sadID=$row->adID; $empty="off"; $AdHead=$row->AdHead; $AdHead = strtolower($AdHead); $AdHead = ucfirst($AdHead); ?>


AdText; ?>
adID; $display=$row->Displays + 1; $cap=$row->Cap; $diff=$cap-$display; if ($diff==0) { $Live="off"; } else {$Live="on"; } // generate and execute query $query = "UPDATE proximityads SET Displays = '$display', Live = '$Live' WHERE adID = '$adID'"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); } //end while() } //end if() // generate and execute query $query = "SELECT * FROM proximityads WHERE Live='on' && Expire>'$servedate' && adID!='$sadID' ORDER BY RAND() LIMIT 1"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); // if records present if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_object($result)) { $sadID2=$row->adID; $AdHead=$row->AdHead; $AdHead = strtolower($AdHead); $AdHead = ucfirst($AdHead); ?>


AdText; ?>
adID; $display=$row->Displays + 1; $cap=$row->Cap; $diff=$cap-$display; if ($diff==0) { $Live="off"; } else {$Live="on"; } // generate and execute query $query = "UPDATE proximityads SET Displays = '$display', Live = '$Live' WHERE adID = '$adID'"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); } //end while() } //end if() // generate and execute query $query = "SELECT * FROM proximityads WHERE Live='on' && Expire>'$servedate' && adID!='$sadID' && adID!='$sadID2' ORDER BY RAND() LIMIT 1"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); // if records present if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_object($result)) { $adID2=$row->adID; $AdHead=$row->AdHead; $AdHead = strtolower($AdHead); $AdHead = ucfirst($AdHead); ?>


AdText; ?>
adID; $display=$row->Displays + 1; $cap=$row->Cap; $diff=$cap-$display; if ($diff==0) { $Live="off"; } else {$Live="on"; } // generate and execute query $query = "UPDATE proximityads SET Displays = '$display', Live = '$Live' WHERE adID = '$adID'"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); } //end while() } //end if() if ($empty=="on") { // generate and execute query $query = "SELECT * FROM proximityads WHERE adID='1'"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); // if records present if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_object($result)) { $sadID=$row->adID; $empty="off"; ?> adID; $display=$row->Displays + 1; $cap=$row->Cap; $diff=$cap-$display; if ($diff==0) { $Live="off"; } else {$Live="on"; } // generate and execute query $query = "UPDATE proximityads SET Displays = '$display', Live = '$Live' WHERE adID = '$adID'"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); } //end while() } //end if() } // end if ?>
EnrollSmart.net
It's Free!

NEED CHILDCARE? Start Here

Sponsored Ads
'$servedate' ORDER BY RAND() LIMIT 1"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); // if records present if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_object($result)) { $sadID=$row->adID; $empty="off"; $AdHead=$row->AdHead; $AdHead = strtolower($AdHead); $AdHead = ucfirst($AdHead); ?>


AdText; ?>
adID; $display=$row->Displays + 1; $cap=$row->Cap; $diff=$cap-$display; if ($diff==0) { $Live="off"; } else {$Live="on"; } // generate and execute query $query = "UPDATE proximityads SET Displays = '$display', Live = '$Live' WHERE adID = '$adID'"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); } //end while() } //end if() // generate and execute query $query = "SELECT * FROM proximityads WHERE Live='on' && Expire>'$servedate' && adID!='$sadID' ORDER BY RAND() LIMIT 1"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); // if records present if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_object($result)) { $sadID2=$row->adID; $AdHead=$row->AdHead; $AdHead = strtolower($AdHead); $AdHead = ucfirst($AdHead); ?>


AdText; ?>
adID; $display=$row->Displays + 1; $cap=$row->Cap; $diff=$cap-$display; if ($diff==0) { $Live="off"; } else {$Live="on"; } // generate and execute query $query = "UPDATE proximityads SET Displays = '$display', Live = '$Live' WHERE adID = '$adID'"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); } //end while() } //end if() // generate and execute query $query = "SELECT * FROM proximityads WHERE Live='on' && Expire>'$servedate' && adID!='$sadID' && adID!='$sadID2' ORDER BY RAND() LIMIT 1"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); // if records present if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_object($result)) { $adID2=$row->adID; $AdHead=$row->AdHead; $AdHead = strtolower($AdHead); $AdHead = ucfirst($AdHead); ?>


AdText; ?>
adID; $display=$row->Displays + 1; $cap=$row->Cap; $diff=$cap-$display; if ($diff==0) { $Live="off"; } else {$Live="on"; } // generate and execute query $query = "UPDATE proximityads SET Displays = '$display', Live = '$Live' WHERE adID = '$adID'"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); } //end while() } //end if() if ($empty=="on") { // generate and execute query $query = "SELECT * FROM proximityads WHERE adID='1'"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); // if records present if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_object($result)) { $sadID=$row->adID; $empty="off"; ?> adID; $display=$row->Displays + 1; $cap=$row->Cap; $diff=$cap-$display; if ($diff==0) { $Live="off"; } else {$Live="on"; } // generate and execute query $query = "UPDATE proximityads SET Displays = '$display', Live = '$Live' WHERE adID = '$adID'"; $result = mysqli_query($connection, $query) or die ("Error in query: $query. " . mysqli_error()); } //end while() } //end if() } // end if ?>