I'm fairly new to PHP and I know this is a well known problem, however I wasn't able to fix it though. According to the mysql log the connection to the database is established and immediately closed.
I attached the code snipped below, thanks for any help. Btw, this error occurs only on the "real" server, using XAMPP I got no problems at all...
$stmt = $conn->prepare("SELECT UID FROM USERS WHERE username = ? and password = ?");
$stmt->bind_param("ss", $g_usernameSql, $g_pwSql);