From: Thomas Mudrunka Date: Fri, 29 Jul 2011 02:59:42 +0000 (+0200) Subject: podrobnejsi hlaseni db chyb, TODO X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=eb5795b64941a6b7dfd1b1fdf92a85943302b2fe;p=mirrors%2FSokoMan.git podrobnejsi hlaseni db chyb, TODO --- diff --git a/index.php b/index.php index d47bbbc..1138613 100755 --- a/index.php +++ b/index.php @@ -294,7 +294,7 @@ class Sklad_DB extends PDO { $result = $this->query($sql); if(!$result) { $error = $this->errorInfo(); - die(trigger_error("QUERY FAILED ($error[0]): $error[2]

QUERY:\n
$sql
")); + die(trigger_error("QUERY FAILED ($error[0],$error[1]): $error[2]

QUERY:\n
$sql
")); } return $result; } @@ -320,7 +320,7 @@ class Sklad_DB extends PDO { if($class && $column['Field'] == $class.$suffix_id) continue; if(!preg_match('/'.$suffix_id.'$/', $column['Field'])) continue; $table=preg_replace('/'.$suffix_id.'$/','',$column['Field']); - $sql = "SELECT $table$suffix_id, $table$suffix_name FROM $table;"; + $sql = "SELECT $table$suffix_id, $table$suffix_name FROM $table;"; //TODO: tabulka nemusi obsahovat *_name!!! momentalne se to tyka jen tabulky user (a item - u ty to nevadi)! $result=$this->safe_query($sql)->fetchAll(PDO::FETCH_ASSOC); foreach($result as $row) $selectbox[$table.$suffix_id][$row[$table.$suffix_id]]=$row[$table.$suffix_name]; }