Ec (2); php implements the code for the previous and next pages of the article. This is used when I want to write a small file. I will share it with you today, I remember my previous thoughts on how to implement the next page in the article. Later I saw in a BBS that it was to judge the current ID and then orderby or asc can be simply implemented. functionnextpage ($ fid, $ tag, $ bid) {& nbsp; if (next $ tag) {& script ec (2); script
Php implements the code for the previous and next pages of the article. This is used when I want to write a small file. I will share it with you today, I remember my previous thoughts on how to implement the next page in the article. Later I saw in a BBS that it was originally to judge the current ID and then order by or asc can be simply implemented.
Function nextpage ($ fid, $ tag, $ bid ){
If ('Next' = $ tag ){
$ SQL = "select * from gx_news where id <$ fid and menu_id = '$ bid' order by id desc ";
} Elseif ('prev' ==$ tag ){
$ SQL = "select * from gx_news where id> $ fid and menu_id = '$ bid' order by id asc ";
}
$ Result = mysql_query ($ SQL );
If (! Mysql_num_rows ($ result )){
Echo ('no more! ');
} Else {
$ Rs = mysql_fetch_array ($ result );
Echo "". $ rs ['new _ title']. "";
}
}
Well, the code is actually very easy. I don't want to talk about it. I just want to show the beginners how to implement the previous and next pages of the article.