Re: "Sense" last record

From: Date: Mon, 09 Apr 2007 15:33:27 +0000
Subject: Re: "Sense" last record
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-252330@lists.php.net to get a copy of this message
Hi, Thank you all for your answers. I solved the problem with: <div id="blocoNews"> <?php include('config.php'); include('adodb/adodb.inc.php'); $debug = 1; // connect to MySQL $conn->debug=1; $conn = &ADONewConnection('mysql'); $conn->PConnect($host,$user,$password,$database); // insert subscription values $recordSet = &$conn->Execute("SELECT id_news, date, now, title, lead, body FROM news ORDER BY now DESC LIMIT 3"); $counter = 0; if (!$recordSet) print $conn->ErrorMsg(); else while (!$recordSet->EOF) {
    $counter++;
     if ($counter == 3)
      $div = '<div class="blocoTextoLast">';
     else
      $div = '<div class="blocoTexto">';
    print($div);
    print '<h3>' . $recordSet->fields[3] . '</h3>' . '<p class="data">'  . $recordSet->fields[1] . '</p>' . '<p>' . $recordSet->fields[4] . '<a href=news.php?news='. $recordSet->fields[0] . '>[+]</a>' . '</p>' . '</div>';
$recordSet->MoveNext(); } echo "<br class=\"clear\">"; $recordSet->Close(); $conn->Close(); ?> <!-- end #secContent --> </div> Warm Regards -- :wq! Mário Gamito

« previous php.general (#252330) next »