if u have timestamp column in ur table then u can order by that column in reverse order
select * from post order by post_time desc
urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24
select a.show_type, a.id, a.description, a.updatetime from
(select 'pic' show_type, colpic_id as id, colpic_desc as description, pictime as updatetime as description from pictable
union
select 'post' show_type, colpost_id as id, colpost_desc as description, posttime as updatetime from postable) a
order by a.updatetime desc
now in php code you u can check our custom show_type column
if ($row['show_type']=='pic')
echo "<img src........>";
else if ($row['show_type']=='post')
echo $row['description'];
urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24
instead of doing showpost, showpic
you just do all in one query in one file only
urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24
you have to merge show.php and showpost.php in one file
merge 2 qery to one query using union
then one while loop to show contents
use that if condition in that while loop
urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24