I am pretty good at PHP but I am not sure how I would go about this. Basically just like on Pixel2Life there are ads after a certain amount of tutorials fetched from the database then the rest of the tutorials are listed. If you could help me out, even just by telling me what to do that would be really great.
Ads in between fetched rows....
Started by drcrazy4, Feb 11 2007 01:38 PM
2 replies to this topic
#1
Posted 11 February 2007 - 01:38 PM
#2
Posted 11 February 2007 - 04:10 PM
I've done it like this.
$query = mysql_query("SELECT * FROM `tutorials`") or die(mysql_error());
$adNum = 4; // Whatever number you want
$count = 0;
while($r = mysql_fetch_array($query)){
if($count == $adNum){
// Echo Ad
$adNum = 0;
}
else $adNum++;
// Echo Tutorial
}
#3
Posted 11 February 2007 - 04:40 PM
Oh wow thats a really easy way of doing it. Thanks for the help.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
