Minor - fixing PHP warnings, format code.
Fixing mysql error.
Adding addslashes to launch_data key see #6681
Minor - fixing PHP warnings.