Commit 37b4a2e0 authored by Marius Burkard's avatar Marius Burkard
Browse files

- fixed mysql syntax errors

parent 2d55adc5
......@@ -55,8 +55,8 @@ class remoting_server extends remoting {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$sql = "SELECT server_id FROM server_ip WHERE ip_address = ? LIMIT 1";
$all = $app->db->queryAllRecords($sql, $ipaddress);
$sql = "SELECT server_id FROM server_ip WHERE ip_address = ?";
$all = $app->db->queryOneRecord($sql, $ipaddress);
return $all;
}
......@@ -206,7 +206,7 @@ class remoting_server extends remoting {
return false;
}
if (!empty($session_id) && !empty($server_name)) {
$sql = "SELECT server_id FROM server WHERE server_name = ? LIMIT 1";
$sql = "SELECT server_id FROM server WHERE server_name = ?";
$all = $app->db->queryOneRecord($sql, $server_name);
return $all;
} else {
......@@ -228,7 +228,7 @@ class remoting_server extends remoting {
return false;
}
if (!empty($session_id) && !empty($server_id)) {
$sql = "SELECT mail_server, web_server, dns_server, file_server, db_server, vserver_server, proxy_server, firewall_server, mirror_server_id FROM server WHERE server_id = ? LIMIT 1 ";
$sql = "SELECT mail_server, web_server, dns_server, file_server, db_server, vserver_server, proxy_server, firewall_server, mirror_server_id FROM server WHERE server_id = ?";
$all = $app->db->queryOneRecord($sql, $server_id);
return $all;
} else {
......
  • Was the change in server_get_serverid_by_ip from queryAllRecord to queryOneRecord really a "syntax error"?? This broke my api calls now - and I don't know how many people also use this function!?

  • The syntax errors were caused by the LIMIT 1 added in the other queries.
    The change from queryAll to queryOne was neccessary as this was a third party commit that did not stick to the form of the other API functions to return a single entry and not an array with a single entry.

  • ok I will adapt my api-calls... unfortunatelly I'm using different ISPConfig-Versions - so now I have to switch between versions. We should consider about publishing such API-Changes in a good visible way... Thanks

Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment