now with error checking

using mysqli_real_escape_string