Ergh. Forgot one step.
Open includes/functions:
GO TO END BEFORE ?> AND ADD
PHP Code:
function create_ad()
{
global $DB_site;
$sponsor = $DB_site->query("SELECT * FROM ads_sponsors ORDER BY RAND(NOW()) LIMIT 1");
$sponsor = $DB_site->fetch_array($sponsor);
return $sponsor;
}
You can call this add on any page by doing:
PHP Code:
$sponsors = create_ad();
and the referring to the field values of the database by $sponsors[id], $sponsors[sponsor], $sponsors[www], $sponsors[logo], $sponsors[clicks].
Hope that helps