Basically it allows the user to enter their website address, and the link to their banner, and its added to a database. These then get passed through some code, and are echoed back to the same page, as you can probably see if you visit that page.
However, I want it to echo them out in to rows and columns..ideally
5 affliates , then go down to the next row.
I’m sure this is possible.
Here is my code for showing the affiliate banners.
[php]
<?php
$query="SELECT * from affiliates ";
$result=mysql_query($query) or die ("Could not execute query: $q.". mysql_error());
while($row=mysql_fetch_array($result)) //gets all results in table
{
extract($row); // extract the row and values
// leave php, html for formatting banners - this is the code that needs tweaking i think.
?>
//echos the $banner into the table, and assigns the matching $url to it so when its clicked, it goes to their website.
Got some fast feedback on that site..I was told to create a counter, and put it in the loop, so when the counter = 5, it culls the row, starts a new one.
From the other site, the script I found, and my modified version:
[php]
<?php
$query="SELECT * from affiliates ";
$result=mysql_query($query) or die ("Could not execute query: $q.". mysql_error());
while($row=mysql_fetch_array($result))
{
extract($row);
$elcount = count($rowl);
$halfel = round($elcount/2);
echo "";
for ($i=1; $i<=$elcount; $i++) {
echo "";
if ($i==$halfel) { echo ""; }
}
echo "