Add db_prepare function

simplify db sql string prepare for the execution