Commit f21fd9d5 authored by tbrehm's avatar tbrehm

Bugfix in remoting library and added several _get functions.

parent d31e9087
This diff is collapsed.
......@@ -603,8 +603,25 @@ class remoting_lib {
function getDataRecord($primary_id) {
global $app;
$escape = '`';
$sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id;
return $app->db->queryOneRecord($sql);
if(@is_numeric($primary_id)) {
$sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id;
return $app->db->queryOneRecord($sql);
} elseif (@is_array($primary_id)) {
$sql_where = '';
foreach($primary_id as $key => $val) {
$key = $app->db->quote($key);
$val = $app->db->quote($val);
$sql_where .= "$key = '$val' AND ";
}
$sql_where = substr($sql_where,0,-5);
$sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$sql_where;
return $app->db->queryOneRecord($sql);
} else {
$this->errorMessage = 'The ID must be either an integer or an array.';
return array();
}
}
function dodaj_usera($params,$insert_id){
......
Markdown is supported
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