I have 3 table. I want to select the data from them order by date. I'm saving the date in unixtimestamp in all table. I'm using the following query:
select
c.up_date, c.user_id, c.id,
f.id, f.up_date, f.friend1, f.friend2, f.status,
s.postdate, s.status, s.id, s.display_name, s.userid, s.userid1
from
c.cover_pic,
s.wp_userstatus,
f.wp_friends
where
s.userid=c.friend1
and s.userid=c.user_id
and f.status=1
and c.user_id=4
order by s.postdate
Tablel structure is: cover_pic table:
id user_id coverpic color up_date
1 4 496b02165600889daf51c6b04b257ec0.jpg 63ACFF 1353069741
wp_friends table:
id friend1 friend2 status up_date
12 1 4 2 1353064093
11 4 1 1 1353064093
wp_userstatus table:
id status display_name userid userid1 postdate
6 awesome paramveer 4 4 1352414658
7 lets paramveer 4 4 1352414932
It is showing the following error:
#1142 - SELECT command denied to user 'kdgadget'@'localhost' for table 'cover_pic'
I want to show the data in order by date.