>>977
ありがとう。
おかげでうまくいきました。

$sql = "select count(*) as reply from post2 where tid = $row[id]";

として新しいフィールドを作ってあげるとうまくできました。感謝!