";
$iPages=ceil($iCountWords/$iOnePage);
if($iCurrPage>$iPages){
$iCurrPage=$iPages;
}
$begin=$iCurrPage*$iOnePage;
$query = "select word_index from user_index where user_id={$UID} order by id DESC limit {$begin},{$iOnePage} ";
$allWord = PDO_FetchAll($query);
$strQuery="('";
foreach($allWord as $one){
$strQuery .= $one["word_index"]."','";
}
$strQuery = substr($strQuery,0,strlen($strQuery)-2);
$strQuery .= ")";
$query = "select * from dict where id in {$strQuery} order by time DESC";
$allWords = PDO_FetchAll($query);
?>