QUOTE (kadyellebee @ Feb 20 2004, 08:14 AM)
It sounds like you may have added this extra SELECT section onto the first query. That's the one that determines how many blogs there are with their titles and so on.
You'll probably have better luck if you integrate that code into the $maxarray instead of $blogarray - that's what controls the output of the latest entry from each blog.
See the 2nd comment on the SG post for specifics.

Kristine
thanks but I can;t get it to post right.... php no0b
CODE
<?
//connection info
include ("/home/bloglici/public_html/connect.php");
//for each of the selected blogs (2, 3, 4, 5, 8, 10, and 14) in mt_blog, find and display in descending order the most recent post in mt_entry.
$alldata = array();
$alldates = array();
$blogcount=12; // keep track of number of blogs
$aspace=" "; // define single word space
$blogarray = "SELECT blog_id, blog_site_url, blog_name, blog_description FROM mt_blog WHERE (blog_id = 1) or (blog_id = 12) or (blog_id = 11) or (blog_id = 8) or (blog_id = 23) or (blog_id = 10) or (blog_id = 15) or (blog_id = 18) or (blog_id = 19) or (blog_id = 20) or (blog_id = 21) or (blog_id = 22)";
$resultblog = mysql_query($blogarray) or die (mysql_error());
while ($rowblog = mysql_fetch_array($resultblog)) {
$burl = ($rowblog['blog_site_url']);
$bname = ($rowblog['blog_name']);
$bdesc = ($rowblog['blog_description']);
$rowarray = "SELECT entry_created_on, entry_id, entry_blog_id FROM mt_entry WHERE (entry_blog_id = (".$rowblog['blog_id'].")) ORDER BY entry_created_on DESC";
$resultid = mysql_query($rowarray) or die (mysql_error());
$count=0;
while ($rowid = mysql_fetch_array($resultid)) {
if ($count>0) { break; } //to ensure that if there are less than 1 posts the blog will not break the query
$maxarray = "SELECT entry_text, entry_title, entry_id, entry_created_on FROM mt_entry WHERE entry_created_on = '".$rowid['entry_created_on']."' and entry_id = ".$rowid['entry_id']; $resultmax = mysql_query($maxarray) or die (mysql_error());
$text = substr(strip_tags($rowmax['entry_text']), 0, 125);
$text = substr($text,0,strlen($text)-strpos(strrev($text),$aspace));
while ($rowmax = mysql_fetch_array($resultmax)) {
$ids = array($rowmax['entry_id']);
$date = ($rowmax['entry_created_on']);
$title = ($rowmax['entry_title']);
//saves the data int alldata array for use outside of the while loop
$alldates[$blogcount++] = $date;
$alldata[$blogcount++] = array('bname'=>$bname, 'burl'=>$burl, 'bdesc'=>$bdesc, 'ids'=>$ids, 'title'=>$title, 'text'=>$text);
}
$count++;
}
}
array_multisort($alldates, SORT_DESC, $alldata);
for ($i=0; $i<sizeof($alldates); $i++) {
//separate date created on up between year, month, and date
$year[$i] = substr($alldates[$i], 2, 2);
$month[$i] = substr($alldates[$i], 5, 2);
$day[$i] = substr($alldates[$i], 8, 2);
//echo date, linked blogtitle and latest entry title
echo '<a href="', $alldata[$i]['burl'], '" target="_blank" title="', $alldata[$i]['bdesc'], '">', $alldata[$i]['bname'], '</a></div>';
echo '<div class="update">', $month[$i], '/', $day[$i], '/', $year[$i], ': ', '<br>';
echo '<div class="uptitle">', $alldata[$i]['title'], '</div>', '<br>';
echo '<div class="text">', $alldata[$i]['entry_text'];
}
?>