Updated formatting (tabs instead of whitespaces).
Changed sql connection to mysqli.