Q: Using JQuery for refreshing page but not getting desire results I am using Jquery for refreshing page i it is refreshing but when i select one option from my category it is refreshing and then my selected category be disappear but i want when i select any one option the page will be refresh but my selected option will also be the same which i selected hope you guys will understand my problem.    
$(function() { $('select[name="cat"]').change(function() { location.href = 'insert_book.php?cat=' + $(this).find('option:selected').val(); }); });
    <select id="rf" name="cat">
                    <option value='null'>Select your Desire</option>
                    <?php
                    include('includes/db.php');
                    $c_query="select * from categories";
                    $c_run=(mysql_query($c_query));
                    while($c_row=mysql_fetch_array($c_run)){
                        $c_id=$c_row['p_id'];
                        $c_title=$c_row['p_title'];
                        echo "<option value='$c_id'>$c_title</option>";
                        }
                    ?>
                </select>


A: Change your refresh code to this:

$(function() {
    $('select[name="cat"]').change(function(ev) { 
        location.href = 'insert_book.php?cat=' + $(ev.currentTarget).val(); 
    }); 
});

Also move this JS code after the HTML code for the select element or wrap it with $(document).ready() like this:

$(document).ready(function(){
    $('select[name="cat"]').change(function(ev) { 
        location.href = 'insert_book.php?cat=' + $(ev.currentTarget).val(); 
    }); 
});

Now in the loop code:
$selectedCategory = array_key_exists('cat', $_GET) ? $_GET['cat'] : 0;
while($c_row=mysql_fetch_array($c_run)){
    $c_id=$c_row['p_id'];
    $c_title=$c_row['p_title'];
    echo "<option value='$c_id'".($selectedCategory == $c_id ? " selected='selected'" :"").">$c_title</option>";
}

Finally:
As Chris Baker mentioned stop using mysql_ and use mysqli_ or PDO.
