X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=c23213f7dd8574d5e27b4b4af8eea77e55c852a7;hb=382324d309a6b80a9d22270e016fb05cfa8d51b5;hp=9e4a67d3ad7a03b954809ada83a66c9547c5b6ba;hpb=6d98215bad86f1b8e33e79e084e529e4a8dbf631;p=mirrors%2FSokoMan.git diff --git a/index.php b/index.php index 9e4a67d..c23213f 100755 --- a/index.php +++ b/index.php @@ -433,6 +433,10 @@ class Sklad_DB extends PDO { return preg_replace('(^.|.$)', '', $this->quote($str)); //TODO HACK } + function quote_identifier($str) { + return '`'.$this->escape($str).'`'; //TODO HACK + } + function build_query_select($class, $id=false, $limit=false, $offset=0, $where=false, $search=false, $history=false, $order=false, $suffix_id='_id') { //Configuration $join = array( @@ -450,9 +454,9 @@ class Sklad_DB extends PDO { $class = $this->escape($class); //SELECT - $sql="SELECT * FROM $class\n"; + $sql="SELECT * FROM `$class`\n"; //JOIN - if(isset($join[$class])) foreach($join[$class] as $j) $sql .= "LEFT JOIN $j USING($j$suffix_id)\n"; + if(isset($join[$class])) foreach($join[$class] as $j) $sql .= "LEFT JOIN `$j` USING($j$suffix_id)\n"; //WHERE/REGEXP if($search) { $search = $this->quote($search);