我从章节 id 的基本表中取出了两个数组。其中一个数组处于章节在 1 到 6 之间的状态。类似地,另一个数组处于同一个表中章节介于 7 到 12 之间的状态。
我的第一个查询在哪里
$sql1 = 'SELECT s.section_number, s.title,n.description,s.global_order_id, c.commentary FROM section as s
INNER JOIN note as n
INNER JOIN commentary as c ON s.global_order_id=n.global_order_id and c.global_order_id=n.global_order_id
where n.user_id='.Yii::app()->user->id.' and s.chapter_id Between 1 and 6';
第二个查询是
$sql2 = 'SELECT s.section_number, s.title,n.description,s.global_order_id, c.commentary FROM section as s
INNER JOIN note as n
INNER JOIN commentary as c ON s.global_order_id=n.global_order_id and c.global_order_id=n.global_order_id
where n.user_id=' . Yii::app()->user->id . ' and s.chapter_id Between 7 and 12';
都是一样的,不同的是根据章节的标题。
当我进行数组合并时,只显示一个标题,但我想将双数组变为单个并显示两个标题。我该怎么做?
提前致谢...