michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2003-12-01 19:35
Návrat hore
Odpovedať s citátom
|
LEFT OUTER JOIN mit_funk ON mit_lnk.funk = mit_funk.ID
Instead PME makes the following:
... LEFT OUTER JOIN mit_funk ON mit_funk.ID = mit_lnk.fink ...
what is the difference ? as far as i know, a=b <=> b=a , but computers seem to surprise me all the time :)
in what way is the result different ?
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2003-12-02 19:31
Návrat hore
Odpovedať s citátom
|
if you delete the whole 'values' option, do the right results appear ?
if no, problem is somewhere else (probably 'options' you need to have 'L' in them to see the list view)
if yes, are the 'values' options defined as in
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.input-restrictions.html
?
if yes, you have to provide more information. from this point of view, everything seems to be correct. i've just noticed some funk >< fink columns, but that's probably a result of rewriting the code.
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2003-12-02 22:54
Návrat hore
Odpovedať s citátom
|
just to make sure, is this line correct ?
$opts['fdd']['mitarbeit']['values']['description']['columns'][0] = 'funktion';
should not there be 'funk' instead of 'mitarbeit' ?
also to avoid some more problems, let's just use the funk column for lookups, with description like
$opts['fdd']['mitarbeit']['values']['description'] = 'funktion';
works for me ?
and again, what's the result ? NULL or ERROR ?
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2003-12-02 23:06
Návrat hore
Odpovedať s citátom
|
As Doug wrote, this is certainly a duplicate name problem.
Can you try, using a different name for 'ID' in each table ?
And if it doesnt work can you put here the output of PME
|
Wolfram
Založený: 02.12.2003
Príspevky: 3
Zaslal: 2003-12-02 23:14
Návrat hore
Odpovedať s citátom
|
| michal Napísal: |
just to make sure, is this line correct ?
$opts['fdd']['mitarbeit']['values']['description']['columns'][0] = 'funktion';
should not there be 'funk' instead of 'mitarbeit' ?
also to avoid some more problems, let's just use the funk column for lookups, with description like
$opts['fdd']['mitarbeit']['values']['description'] = 'funktion';
works for me ?
and again, what's the result ? NULL or ERROR ? |
Sorry, you were write about the line, I've corrected that, but it still doen't work. I've deleted the part of joining mitarbeit, the result is the same, error is:
phpMyEdit error: invalid SQL query
--------------------------------------------------------------------------------
SELECT PMEtable0.ID AS qf0,PMEtable0.mitarbeit AS qf1,CONCAT(PMEjoin2.funktion) AS qf2,PMEtable0.funk AS qf2_idx FROM mit_lnk AS PMEtable0 LEFT OUTER JOIN fu-admin.mit_funk AS PMEjoin2 ON PMEjoin2.ID = PMEtable0.funk ORDER BY PMEtable0.ID,PMEtable0.mitarbeit LIMIT 0,156.807 miliseconds
Wolfram
|
Wolfram
Založený: 02.12.2003
Príspevky: 3
Zaslal: 2003-12-02 23:18
Návrat hore
Odpovedať s citátom
|
| hbernard Napísal: |
As Doug wrote, this is certainly a duplicate name problem.
Can you try, using a different name for 'ID' in each table ?
And if it doesnt work can you put here the output of PME |
OK, I've changed the ID to lnk_ID and to funk_ID, output of PME is:
phpMyEdit error: invalid SQL query
--------------------------------------------------------------------------------
SELECT PMEtable0.ID AS qf0,PMEtable0.mitarbeit AS qf1,CONCAT(PMEjoin2.funktion) AS qf2,PMEtable0.funk AS qf2_idx FROM mit_lnk AS PMEtable0 LEFT OUTER JOIN fu-admin.mit_funk AS PMEjoin2 ON PMEjoin2.funk_ID = PMEtable0.funk ORDER BY PMEtable0.ID,PMEtable0.mitarbeit
Wolfram
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2003-12-02 23:20
Návrat hore
Odpovedať s citátom
|
problem is with - in table or column name.
it is a known bug, but nobody has time to repair this.
solution
either
rename - to _ or something like that
or
add `` to every sql command in pme (it should be like `colname` AS ...)
multiple ID should not be a problem, or it should also appear if you use the same table for joining twice, shouldn't it ?
|
Wolfram
Založený: 02.12.2003
Príspevky: 3
Zaslal: 2003-12-02 23:24
Návrat hore
Odpovedať s citátom
|
| michal Napísal: |
problem is with - in table or column name.
it is a known bug, but nobody has time to repair this.
solution
either
rename - to _ or something like that
or
add `` to every sql command in pme (it should be like `colname` AS ...)
|
Do you mean the part 'fu-admin...'? fu-admin is the name of the database. I was thinking about that after browsing through the bug reports just now ...
But on the other hand I am using PME for other tables in the same database without any problems ...
Thanks, Wolfram
|
phirschybar
Založený: 18.09.2003
Príspevky: 43
Zaslal: 2003-12-29 05:00
Návrat hore
Odpovedať s citátom
|
I'm having the same problem as Wolfram. I'm hoping that someone can shed some light on this.
I have 2 joins occurring in the same calling script
JOIN ONE:
$opts['fdd']['restneighborhood'] = array(
'name' => 'Location',
'select' => 'D',
'maxlen' => 150,
'required' => false,
'sort' => true,
);
$opts['fdd']['restneighborhood']['values']['table'] = 'locations';
$opts['fdd']['restneighborhood']['values']['column'] = 'locid';
$opts['fdd']['restneighborhood']['values']['description']['columns']['0'] = 'location';
JOIN TWO:
$opts['fdd']['restcuisinelist'] = array(
'name' => 'Cuisine As Linked',
'select' => 'D',
'maxlen' => 150,
'options' => 'ACPVDF',
'required' => false,
'sort' => true,
);
$opts['fdd']['restcuisinelist']['values']['table'] = 'cuisines';
$opts['fdd']['restcuisinelist']['values']['column'] = 'id';
$opts['fdd']['restcuisinelist']['values']['description'] = 'title';
The strange thing here is that JOIN TWO is working PERFECTLY but JOIN ONE returns an error:
ERROR:
MySQL error 1
Can't create/write to file '/var/tmp/#sql1731_f9_12.MYI' (Errcode: 13)
--------------------------------------------------------------------------------
phpMyEdit error: invalid SQL query
--------------------------------------------------------------------------------
SELECT PMEtable0.restid AS qf0,PMEtable0.restname AS qf1,PMEtable0.restaddress AS qf2,CONCAT(PMEjoin3.location) AS qf3,PMEtable0.restneighborhood AS qf3_idx,PMEtable0.restimage AS qf5,PMEtable0.restlogo AS qf6,PMEtable0.restbuzz AS qf7,PMEtable0.restbuzz AS qf7_idx,PMEtable0.restpublish AS qf8,PMEtable0.restpublish AS qf8_idx FROM restaurants AS PMEtable0 LEFT OUTER JOIN grm_nyc.locations AS PMEjoin3 ON PMEjoin3.locid = PMEtable0.restneighborhood LEFT OUTER JOIN grm_nyc.cuisines AS PMEjoin10 ON PMEjoin10.id = PMEtable0.restcuisinelist ORDER BY PMEtable0.restname LIMIT 0,20
I cant figure this out for the life of me. I figured that there may be an issue with having two joins in the same script but that isnt it since I eliminated JOIN TWO and still get the error.
Help me please. Thanks!
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-01-05 22:27
Návrat hore
Odpovedať s citátom
|
the only bad think i see is "CONCAT(PMEjoin3.location) AS qf3,PMEtable0.restneighborhood AS qf3_idx" , the CONCAT issue in cooperation with a join.
does it work properly if you remove SQL option ?
|
phirschybar
Založený: 18.09.2003
Príspevky: 43
Zaslal: 2004-01-06 04:01
Návrat hore
Odpovedať s citátom
|
hmmm... how can I remove the SQL option?
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-01-06 04:13
Návrat hore
Odpovedať s citátom
|
you probably have something like
$opts['fdd']['restneighborhood']['SQL'] = 'CONCAT ...
in your PME configuration file, just comment it out.
if no, where is that CONCAT in the query coming from ?
|
phirschybar
Založený: 18.09.2003
Príspevky: 43
Zaslal: 2004-01-06 04:19
Návrat hore
Odpovedať s citátom
|
'CONCAT' must be coming from the core class, built in to assist with joining tables.
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-06 08:50
Návrat hore
Odpovedať s citátom
|
| phirschybar Napísal: |
| 'CONCAT' must be coming from the core class, built in to assist with joining tables. |
yes, because this line :
$opts['fdd']['restneighborhood']['values']['description']['columns']['0'] = 'location';
You set an Array() of size 1 for description, and then concat() is performed.
Why don't you use :
$opts['fdd']['restneighborhood']['values']['description'] = 'location';
|
|
Odoslať novú tému
Odpovedať na tému
|