I'm sure there is more than one way to do this, but this is how I do it. I use the same page to list, edit or add, but I've remove the add portion. Hope it helps.
function display_list()
{
global $message;
$sql = "Select saleid, title, price from yourtable order by title";
$result =...