$query = $_SGLOBAL['db']->query("SELECT main.*, field.*, topic.*
FROM ".tname('blog')." main
LEFT JOIN ".tname('blogfield')." field ON field.blogid=main.blogid
inner join ".tname('topic')." topic ON topic.topicid=main.topicid
WHERE ".implode(' AND ', $wherearr)."
ORDER BY main.{$order} $sc LIMIT 0,$shownum");
$bloglist = array();
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$value['message'] = getstr($value['message'], 86, 0, 0, 0, 0, -1);
$value['subject'] = getstr($value['subject'], 50, 0, 0, 0, 0, -1);
$bloglist[] = $value;
}
if($_SGLOBAL['network']['blog']['cache']) {
swritefile($cachefile, serialize($bloglist));
}
解决了三表查询,可是怎么输出两个表中的subject |