English > General Questions
jddatabase.php addJoinKeys bug
(1/1)
Finarfin:
Just you know, if the $sql argument passed have more than two tables in the from, something like
Select * from actual as a, brave as b
It will happen a sql error cause the constructed query here
$sql->select($alias.'.'.$primarykey.' AS JD_MAGIC_KEY_'.$jdkey);
will be something as
select a,.id as JD_MAGIC_KEY_1
I donĀ“t know if this bug only happened to me because we are doing something strange in our module, but here is for you to know ;)
By the way, we solved it with a simple
$alias = str_ireplace(',', '', $alias);
before
if ($alias == '') {
$alias = $tablename;
}
Harald Leithner:
Could you please give me the complete original query and are you using jdatabasequery to construct it.
because its seams to fail to find the correct table alias "a".
And if I see it correct you are using jdatabasequery maybe you could give me the php code where the from clause is in.
Navigation
[0] Message Index
Go to full version