Re: "Sense" last record

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux