|
Posted by Annie on 11/16/05 18:16
Thanks worked great....
"Hilarion" <hilarion@SPAM.op.SMIECI.pl> wrote in news:dlf76b$s8l$1
@news.onet.pl:
> $result = mysql_query(
> 'SELECT ' .
> ' url, title, text, date, ' .
> ' ADDDATE( date, INTERVAL expiration DAY ) AS expiration_date ' .
> 'FROM text_ads ' .
> 'WHERE ADDDATE( date, INTERVAL expiration DAY ) >= CURRENT_DATE() ' .
> 'ORDER BY date DESC'
> );
> if ($result === FALSE)
> {
> die( 'Error executing query: ' . mysql_error() );
> }
> ?>
> <table border="1" width="125">
> <tbody>
> <?php
> while ($row = mysql_fetch_array($result))
> {
> ?>
> <tr>
> <td><a class="link" href="<?php
> echo htmlspecialchars( $row['url'] );
> ?>" target="_blank"><?php
> echo htmlspecialchars( $row['title'] );
> ?></a></td>
> </tr>
> <tr>
> <td align="center"><?php
> echo htmlspecialchars( $row['text'] );
> ?></td>
> </tr>
> <tr>
> <td align="center"><?php
> echo $row['expiration_date'];
> ?></td>
> </tr>
> }
> ?>
> </tbody>
> </table>
>
[Back to original message]
|