old function cleanup 2nd

Remove ,$sql from old legacy functions