i've handled it

)
thanks to Abe1 !
i've added everywhere - " . TABLE_PREFIX . "
and here is the final strings:
$post_thanks_cashe = $db->query("SELECT " . TABLE_PREFIX . "post_thanks.* FROM " . TABLE_PREFIX . "post_thanks, " . TABLE_PREFIX . "post WHERE " . TABLE_PREFIX . "post.postid = " . TABLE_PREFIX . "post_thanks.postid AND " . TABLE_PREFIX . "post.threadid = '$post[threadid]' ORDER BY " . TABLE_PREFIX . "post_thanks.username ASC");