diff --git a/code/web/public_php/login/class/ConnectionHandler.php b/code/web/public_php/login/class/ConnectionHandler.php index 6a29fbb2a..2b14e21a8 100644 --- a/code/web/public_php/login/class/ConnectionHandler.php +++ b/code/web/public_php/login/class/ConnectionHandler.php @@ -149,10 +149,10 @@ class ConnectionHandler setMsgLanguage($lang); $domainName = $mysqli->escape_string($clientApplication); - if ($stmt = $mysqli->prepare("SELECT TOP 1 domain_id FROM domain WHERE domain_name='?'")) { + if ($stmt = $mysqli->prepare('SELECT domain_id FROM domain WHERE domain_name=\'?\' LIMIT 1')) { $stmt->bind_param("s", $domainName); $stmt->execute(); - $stmt->bind_result($result) or die(errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); + $stmt->bind_result($result) or die(errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, $db_Connection->error)); $stmt->fetch(); if ($stmt->num_rows == 0) { // unrecoverable error, we must giveup