Вот часть вывода
array (7) {["type"] => string (16) "new post comment" ["book_id"] => string (1) "1"["name"] => строка (9) "что угодно" ["author_id"] => строка (4) "тест" ["содержание"] => строка (19) "2011-07-16 03:20:01"[" create_time "] => string (1)" 3 "[" id "] => string (1)" 1 "}
И это часть моего запроса
SELECT 'bookcomment' AS type
,b.book_id
,b.name
,c.book_id
,c.author_id
,c.content
,c.create_time AS create_time
,u.id
,u.name
FROM tbl_book AS b,
tbl_book_comment AS c,
tbl_user AS u
WHERE u.id=c.author_id in (1,2) AND b.book_id=c.book_id
UNION ALL
SELECT 'new post comment' AS type
,po.post_id
,po.title
,pc.author_id
,pc.content
,pc.create_time AS create_time
,pc.post_id
,u.id
,u.name
FROM tbl_post as po,
tbl_post_comment as pc,
tbl_user as u
WHERE u.id=pc.author_id in(1,2) AND po.post_id=pc.post_id
UNION ALL
SELECT 'bookrating' AS type
,b.book_id as one
,b.name
,ra.book_id
,ra.user_id
,ra.rating
,ra.create_time AS create_time
,u.id
,u.name
FROM tbl_book AS b,
tbl_user_book_rating AS ra,
tbl_user AS u
WHERE u.id=ra.user_id in (1,2) AND b.book_id=ra.book_id
UNION ALL...
ORDER BY create_time DESC
Как показано в результате, данные, соответствующие «author_id», должны соответствовать «content», а «content» должно быть «create_time».Что не так с моим запросом?