halfway through updating mysql code for php 5.5 where old mysql functions are deprecated