Forum Moderators: coopster
It is being rolled out across our site and so far on 2 out of 3 areas I've put it on there's no problem.
In one place though the script is duplicating the content, at a point after $objectid is defined if my testing is good.
I think the error is somewhere inside the 2nd while loop but I can't see it.
<?php
mysql_select_db ('ggr_blog');
$wpbase = $site;
$wpcat = mysql_query ("SELECT * FROM wp_terms WHERE slug = '$wpbase' LIMIT 1 ");
while ($wpcatrow = mysql_fetch_array ($wpcat)) {
$wpcatid = $wpcatrow['term_id'];
}
$object = mysql_query ("SELECT * FROM wp_term_relationships WHERE term_taxonomy_id = '$wpcatid' LIMIT 3");
while ($objectrow = mysql_fetch_array($object)) {
$objectid = $objectrow['object_id'];
//done
$posts = mysql_query ("SELECT * FROM wp_posts WHERE ID = '$objectid' LIMIT 3");
$postsrow = mysql_fetch_array ($posts);
echo '<p>'. $postsrow['post_title']. '<br>';
echo '<a href="'. $postsrow['guid']. '">Read More...</a></p>';
}
?>