I am having comment reply (only till one level) functionality. All comments can have as many as replies but no replies can have their further replies.
So my database
You can use an expression in an ORDER BY. Try this:
SELECT *
FROM comments
ORDER BY IF(ParentId = 0, Id, ParentId), Id
This will first sort by Id, if ParentId = 0, or by ParentId otherwise. The second sort criterion is the Id, to assure that replies are returned in order.
I highly recommend that you restructure your database schema. The main problem is that you are trying to treat comments and replies as the same thing, and they simple aren't the same thing. This is forcing you to make some difficult queries.
Imagine having two tables: [COMMENTS:(id, text)], and replies to comments in another table [REPLIES(id, commentid, text)]. The problem seems much, much easier when thought of in this way.
If you / somebody is looking for simple solution, then it might be helpfull.
Structure Change - I suppose you have changed it by adding Blog ID, If there is no blog ID, how do you say which comments are specific to a Blog?
First do this, it won't harm anything to your database,
update `tblcomments` set ParentId=Id where ParentId=0;
then to get the blog comments and comment replies in order (comment - reply 1, reply 2... under the comment)
use the bleow query
SELECT *
FROM tblcomments
ORDER BY ParentId ASC;
Cheers, -PM.