|
phpMyEdit - Rozšírené detaily chyby |
[ Späť ]
|
|
|
ID:
|
Kategória:
|
Dôležitosť:
|
Reprodukovateľnosť:
|
Dátum vloženia:
|
Posledná zmena:
|
|
146 |
core / general |
triviálna |
vždy |
2003-12-15 20:36 |
2004-02-20 13:12 |
|
|
Autor:
|
Feike |
Platforma:
|
|
|
|
Priradené:
|
nepto |
OS:
|
|
|
|
Priorita:
|
normálna |
Verzia:
|
|
|
|
Stav:
|
uzavretý |
Verzia produktu:
|
current from CVS |
|
|
Build produktu:
|
|
Riešenie:
|
duplicitný |
|
|
Projection:
|
žiadny |
Duplicitné ID:
|
0000094 |
|
|
ETA:
|
žiadny |
|
|
|
Zhrnutie:
|
Can't use group as column name |
|
Popis:
|
I have a table with a column name 'group' in it. But when I want to update this table, phpMyEdit gives an error. |
|
Kroky k vyvolaniu:
|
1. Create a table with a column-name named 'group'
2. Try to update, or insert a field.
|
|
Dalšie informácie:
|
I found out that in an query the column names are not quoted. For example:
SELECT id,group FROM groups WHERE id='424';
will not work because of 'group' as in GROUP BY. It will work if the column names are quoted, as in:
SELECT 'id', 'group' FROM groups WHERE id='424';
|
|
Pripojené súbory:
|
0000146-backquotes.diff.txt (1 KB) 1970-01-01 01:33 |
|
Poznámky k chybe |
|
|
|
Yes, we know about this issue.
This could be probably solved by quoting column/table/etc names.
Thank you for reporting! |
|
|
|
|
Okay, sorry about that, I just saw that bug-report.
It says how to quote table names, but how do I quote field names? |
|
|
|
|
if field name is the same as column name, then should be quoted the same way (`field_name`)(the quote below esc button).
without quoting, apps will break in these cases:
column names are reserved words, like group, select, limit, and, column, ...
column names containing . (dot) and -(minus)
(and probably more cases) |
|
|
|
hbernard
|
|
2003-12-21 12:23
|
|
There is a workaround for this :
just put the field's name into backquotes.
like this : $opts['fdd']['`group`']
This needs a FAQ entry, or a comment about field definition.
BUT, this break javascript validation. (backquotes doesn't seem to be a valid javascript character)
patch backquotes.diff fix this by removing backquotes in field names wrote in javascript. |
|
|
|
|
|
This is a duplicated entry. |
|