& Lt; html & gt; & lt; title & gt; message book & lt;/title & gt; & lt; bodybgcolorwhite & gt; & lt; head & gt; & lt; metahttp-equivContent-Typecontenttext/html; charsetgb2312 & gt; & lt; styletypetext/
Message book
Message
Require (config. php (as the mainstream development language ));
?>
$ Initial_record = 0;
$ Sort_field = key_liuyan;
$ Sort_direction = DESC;
If (strlen ($ arr_request [initial_record])
{
$ Initial_record = $ arr_request [initial_record];
$ Sort_field = $ arr_request [sort_field];
$ Sort_direction = $ arr_request [sort_direction];
}
$ Str_ SQL _all = "select count (*) as number_of_records from $ table_name ";
$ Result = MySQL (the best combination with PHP) _ db_query ($ db_name, $ str_ SQL _all, $ id_link );
If (! Result)
{Affy_error_exit (SQL select execution has failed .);}
$ Record = @ MySQL (the best combination with PHP) _ fetch_object ($ result );
$ Number_of_records = $ record-> number_of_records;
If (strlen ($ sort_field) = 0)
{
$ Str_ SQL = "select * from $ table_name
Limit $ initial_record, $ number_records_to_display ";
}
Else
{
$ Str_ SQL = "select * from $ table_name order by $ sort_field $ sort_direction
Limit $ initial_record, $ number_records_to_display ";
}
$ Result = MySQL (the best combination with PHP) _ db_query ($ db_name, $ str_ SQL, $ id_link );
If (! $ Result)
{Affy_error_exit (SQL select execution has failed .);}
$ Number_of_records_on_current_page = @ MySQL (the best combination with PHP) _ num_rows ($ result );
If ($ number_of_records <1)
{Echo
No data in the table!
;}
Else
{
$ Next_index = $ initial_record + $ number_records_to_display;
If ($ next_index> $ number_of_records)
$ Next_index = $ number_of_records;
$ Prev_index = $ initial_record-$ number_records_to_display;
If ($ prev_index <0)
{
$ Prev_index = 0;
}