Using range slider to query records from db

Using range slider to query records from db

I'm very new to all of jQueryUI and I've played very little with javascript and Ajax.  My background is mostly PHP and MySQL.
 
that said, here is the task I would like to perform...
 
using jQueryUI Slider (range)
 
1) Main page PHP: Query a range of values from the database for the max and min values and set those as the max and min value for the slider.
 
2) as the slider range is changed have the min and max values adjust the "where" conditions on another query to pull up other values that fall between the sliders range. 
 
I supspect there are two ways of accomplishing #2,
 
A) use an Ajax type solution to pass the values to another page that runs the query and creates the display
B) preload the current page with an array of values that is then accessed and presented based on the slider values.
 
Neither of which do have a strong grasp on how to do.  Can anyone point me in the correct direction?