ajax post and db query working