Php Substring Replace In Sql