Added a lot of null checker to many fiels and replaced all mysql_escape_real_string with addslashes