podrobnejsi hlaseni db chyb, TODO
authorThomas Mudrunka <tomas@mudrunka.cz>
Fri, 29 Jul 2011 02:59:42 +0000 (04:59 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Fri, 29 Jul 2011 02:59:42 +0000 (04:59 +0200)
index.php

index d47bbbc490c92802c05ac5a3c53c08f5b69d2a91..1138613d9e158f4649b245150dce6af9a213d8bc 100755 (executable)
--- 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("<font color=red><b>QUERY FAILED ($error[0]): </b>$error[2]<br /><br /><b>QUERY:</b>\n<pre>$sql</pre></font>"));
+                       die(trigger_error("<font color=red><b>QUERY FAILED ($error[0],$error[1]): </b>$error[2]<br /><br /><b>QUERY:</b>\n<pre>$sql</pre></font>"));
                }
                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];
                }
This page took 0.106533 seconds and 4 git commands to generate.