Re-factored so a functions handles assigning the data to the prepared statement to replace c&p code
new function called assignVariables