Replaced the many parameter creation snippets with a helper function, DB::placeholders
Converted many queries to parameterised queries