how do you get the last 3 db entries to be printed out. I have the mysql_fetch_array function, but i'm only sure on how to print out the field entries for one row, does anyone have a really generic example or a good bit of code to work off of?
another problem is that i will be parsing this inside of some javascript (if that's possible)
printing last 3 db entries
Moderator: General Moderators
-
fariquzeli
- Forum Contributor
- Posts: 144
- Joined: Mon Jun 24, 2002 9:16 am
- Location: Chicago
- Contact:
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
-
fariquzeli
- Forum Contributor
- Posts: 144
- Joined: Mon Jun 24, 2002 9:16 am
- Location: Chicago
- Contact:
Code: Select all
<?php require_once('Connections/ydntNews.php'); ?>
<?php
mysql_select_db($database_ydntNews, $ydntNews);
$query_news = "SELECT * FROM news ORDER BY id DESC";
$news = mysql_query($query_news, $ydntNews) or die(mysql_error());
$row_news = mysql_fetch_assoc($news);
$totalRows_news = mysql_num_rows($news);
$i = 0;
do {
echo("messagesї$i-1]='<font face=verdana color=#ffffff size=1>$row_newsї'headline']</b><br> :<a href=http://www.yiinc.com/news.php?id=$row_newsї'id']><font color=#cccccc>Full Story</a></font>");
$i++;
}
while ( $i < 3 );
?>Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/ttoomey/ydnt.com/messageTest.php on line 13
-
fariquzeli
- Forum Contributor
- Posts: 144
- Joined: Mon Jun 24, 2002 9:16 am
- Location: Chicago
- Contact: