[thelist] Okay now stuck on to step #2

Abdullah Mancy mancy3000 at gmail.com
Wed Nov 26 11:31:01 CST 2008


$sql ="select * from textads";  /* query */
$result= mysql_query($sql);

$num=mysql_num_rows($result);

On Wed, Nov 26, 2008 at 7:20 PM, Terion Miller <webdev.terion at gmail.com>wrote:

> 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
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list