2014-02-16, 02:21 AM
I have this quire:
I am creating a plugin to show last posts in profile but for some reason post pid is wrong!
How to get post pid?
$query = $db->query("
SELECT p.*, p.message AS postmessage, p.subject AS postsubject, p.dateline AS postdate, t.*, t.subject AS threadsubject, u.*, f.*
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=p.fid)
WHERE p.uid = '{$memprofile['uid']}'
ORDER BY p.pid DESC
LIMIT 0, {$postlimit}
");
$pid = $posts['pid'];
$postlink = get_post_link($posts['pid'], $posts['tid']);
<a href=\"$postlink#pid$pid\"></a>
I am creating a plugin to show last posts in profile but for some reason post pid is wrong!
How to get post pid?