Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Pondelok, 30. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Table lookup You have an error in your SQL syntax near --

phpMyEdit Installation     Table lookup You have an error in your SQL syntax near --
Odoslať novú tému   Odpovedať na tému    
 
cas     Založený: 19.03.2004   Príspevky: 3  
Príspevok Zaslal: 2004-03-19 17:02
Návrat hore  Odpovedať s citátom     

hello here parts of the code:

$opts['fdd']['cat'] = array(
'name' => 'Cat',
'select' => 'D',
'maxlen' => 20,
'sort' => true
);

$opts['fdd']['cat']['values'] = array(
'table'=>'Alterskategorien',
'column'=>'kate'
);
//$opts['fdd']['Cat']['values']['db']='cas_lu_-_intern';
//$opts['fdd']['Cat']['values']['table']='Alterskategorien',
//$opts['fdd']['Cat']['values']['column']='kate',



and here the error message:

You have an error in your SQL syntax near
'-_intern.Alterskategorien ORDER BY kate' at line 1


What's wrong please help

 
hbernard     Založený: 23.03.2003   Príspevky: 159   Bydlisko: FRANCE
Príspevok Zaslal: 2004-03-19 17:41
Návrat hore  Odpovedať s citátom     

you certainly wrote :
$opts['sort_field'] = array('kate');

but you meant :
$opts['sort_field'] = array('cat');

_________________
hbernard - phpMyEdit updater.
 
cas     Založený: 19.03.2004   Príspevky: 3  
Príspevok Zaslal: 2004-03-19 21:15
Návrat hore  Odpovedať s citátom     

hbernard Napísal:
you certainly wrote :
$opts['sort_field'] = array('kate');

but you meant :
$opts['sort_field'] = array('cat');



No the name of the table-column from where Iwant to take the value is realy kate - or must the columns of the two tables have the same name?

I have the meening that maybe the name of the database ('cas_lu_-_intern')with the - inside make some problems ??,but the prefix of the databasename cas_lu_- is unchangebale

the error message appaers in the column cat
when I open the query window, or the modify window
see at this link: http://www.cas.lu/phpMyEdit-5.4/lizenzen.php

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2004-03-20 16:41
Návrat hore  Odpovedať s citátom     

see orderby variable in table joining options
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.input-restrictions.html#AEN816

if i understand this right

 
cas     Založený: 19.03.2004   Príspevky: 3  
Príspevok Zaslal: 2004-03-22 00:02
Návrat hore  Odpovedať s citátom     

MySQL error 1064
You have an error in your SQL syntax near '-_intern.test WHERE eins IN (1,2,3) ORDER BY zwei' at line 1


I changed my code like this:
I made another table named test.
I wrote the code like seeing in specifications.

now I tried :

//$opts['fdd']['cat']['values'] = array(
//'table'=>'Alterskategorien',
//'column'=>'kate'
//);
//$opts['fdd']['Cat']['values']['db']='cas_lu_-_intern';
$opts['fdd']['Cat']['values']['table']='test';
$opts['fdd']['Cat']['values']['column']='eins';
$opts['fdd']['Cat']['values']['orderby'] = 'zwei'; // optional ORDER BY clause
$opts['fdd']['Cat']['values']['filters'] = 'eins IN (1,2,3)'; // optional WHERE clause

when I dont use the filter option there is also still an error.

I realy think now its the databasename with the strike - who makes the problem !!???

I tried the suggestions in buglist:

to $opts['db'] = '`my-db`';
but then it did not work:
MySQL error 1044
Access denied for user: '****@localhost' to database '`cas_lu_-_intern`'

Now I haven't any idea!! did you ??

 
TXMagpie     Založený: 24.11.2004   Príspevky: 2  
Príspevok Zaslal: 2004-11-24 03:44
Návrat hore  Odpovedať s citátom     

I have the same problem. My host forces me to have a dash in my database name (foo_db_-_more_foo) and my phpMyEdit generated script won't run. Is there a way around this?

Thanks,
TXMagpie

 
TXMagpie     Založený: 24.11.2004   Príspevky: 2  
Príspevok Zaslal: 2004-11-24 03:55
Návrat hore  Odpovedať s citátom     

This seems to only be a problem on a page where I am using another table as a lookup table (LEFT OUTER JOINs generated by script). On a page that doesn't have lookups, everything works fine even with the dashes in the database name.

As a workaround for my install, I just took out the database name specification in the function create_join_clause():

old:
Kód:
$join .= " LEFT OUTER JOIN $db.$table AS $alias";


new:
Kód:
$join .= " LEFT OUTER JOIN $table AS $alias";


but I don't know if this is a valid real fix. I only have one database, so it's okay for me.

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2004-11-24 09:27
Návrat hore  Odpovedať s citátom     

the problem is that table names are not included in `` or "" (or what's the correct syntax). there is a bug report on this.

workaround, make
$opts['fdd']['`col-name`']...
declare the column name with `` (quotes on keyboard below esc key).

(remember that this will break js scripts and you will have to rewrite your declaration scropts when we solve this.)

or even better it would be great to have this patch, so we can continue this discussion in that bug report.

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov