I have tried
$query_p = "SELECT * FROM ^posts
WHERE type='Q' and postid < [id]
ORDER BY postid DESC LIMIT 1";
and
$query_p = "SELECT * FROM ^posts
WHERE type='Q' and postid < {postid}
ORDER BY postid DESC LIMIT 1";
But none of getting current question id