DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Next & Previous Records
// finds the previous record and next record id
$previous_sql = mysql_query("SELECT MAX(csr_id) csr_id FROM csr_entry WHERE (csr_id<'$csr_id')") or die (mysql_error());
$previous_record = mysql_result($previous_sql,"csr_id");
$next_sql = mysql_query("SELECT MAX(csr_id) csr_id FROM csr_entry WHERE (csr_id>'$csr_id')") or die (mysql_error());
$next_record = mysql_result($next_sql,"csr_id");





