[thelist] Okay now stuck on to step #2
Terion Miller
webdev.terion at gmail.com
Wed Nov 26 11:20:18 CST 2008
Ok now I'm on step 2, getting my db to output into a 3 column table (banner
really as these are supposed to be text ads)
I'm stuck in that ;
1. what I have from a tutorial isn't working
2. I have to randomize the text ads and count exposures and send that count
back to the db to be used against how many exposures are purchased.
3. I have to limit the amount of text (blurb) will show as it has to be
constrained in a 728x90 3 column table.
Here is my code so far (which doesn't work) so point and laugh then please
help steer me (if you know of good tutorials or scripts that do this it
would be kindly appreciated) I'm not getting much help from googling.
I adapted (incorrectly it would seem) this from the tutorial here:
http://www.sitepoint.com/article/publishing-mysql-data-web/2/
The sad code:
<?php include 'inc/dbconnOpen.php';
$sql = mysql_query("select * from textads"); /* query */
$result=mysql_query($sql);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Database Output</center></b><br><br>";
$i=0;
while ($i < $num) {
$href=mysql_result($result,$i,"href");
$blurb=mysql_result($result,$i,"blurb");
$title=mysql_result($result,$i,"title");
echo "<table width=728 border=1><tr><td><b>$title<br> <a
href='$href'>$blurb</a></b></td><td><b>$title<br> <a
href="$href">$blurb</a></b></td><td><b>$title<br> <a
href='$href'>$blurb</a></b></td></tr></table>";
$i++;
}
?>
is everyone rolling on the floor yet.
Terion
More information about the thelist
mailing list