"Sense" last record

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

 



Hi,

I'm doing this site that has three news in the homepage.
You can see the static version here:
http://www.telbit.pt
As you can see, the two first news have "blocoTexto" class and the third, "blocoTextoLast"

Now, i'm developing a dinamyc structure where the news are stored in a MySQL database and retrieved from there.

My problem is with the third news and it's different class.
I'm using AdoDB recordSet to get the news from the database.
You can see it here:
http://www.telbit.pt/2/

How can i "sense" that i've reached the last row and apply the "blocoTextoLast" class to it ?

My code follows my signature.

Any help would be appreciated.

Warm Regards
--
:wq! Mário Gamito
--
<div id="blocoNews">
 <?php
  include('config.php');
  include('adodb/adodb.inc.php');

  // connect to MySQL
  $conn->debug=1;
  $conn = &ADONewConnection('mysql');

$conn->PConnect($host,$user,$password,$database);

  // get news data
$recordSet = &$conn->Execute("SELECT date, now, title, lead, body FROM news ORDER BY date DESC LIMIT 3");

 if (!$recordSet)
  print $conn->ErrorMsg();
 else
  while (!$recordSet->EOF) {
print '<div class="blocoTexto">' . ' <h3>' . $recordSet->fields[2] . '</h3>' . '<p class="data">' . $recordSet->fields[0] . '</p>' .
'<p>' . $recordSet->fields[3] . '</p>' . '</div>';

 $recordSet->MoveNext();
}
 echo "<br class=\"clear\">";	

 $recordSet->Close();
 $conn->Close();
?>  <!-- end #secContent --> 	
</div>

--
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