Hi i would like to show a random ad based on keyword.
For e.g i have 3 technology ads and i would like the PHP to randomly choose a ad to show this is what i have.
This script does work but it just randomly chooses the ad to show.Code:<?php $ads = "SELECT * FROM ads ORDER BY RAND()LIMIT 1"; $adsresult = mysql_query($ads); while($row = mysql_fetch_array($adsresult)) echo"{$row['file']}&displaywidth={$row['displaywidth']}&displayheight={$row['displayheight']}";?>
Thanks



Reply With Quote

Bookmarks