Updated The maser from you last push

I went through much of my code and added the MYSQL_real_escape_string() to protect against sql injections.