Bug #20137
closedDBAL where clauses not handled correctly
0%
Description
When you have something like
marks.CONTENT = CONTENT
marks.CONTENT.table = tt_content
marks.CONTENT.select {
pidInList = this
orderBy = sorting
where = colPos=0
andWhere = header <> ''
languageField = sys_language_uid
}
it works with MySQL but not with DBAL. I guess that the SQL parameters are not passed correctly. I don't get any syntax working.
DBAL keeps telling me
Warning: Invalid argument supplied for foreach() in /cms/typo3conf/ext/dbal/class.ux_t3lib_db.php on line 966
Any ideas how to use more complex SQL queries with dbal?
(issue imported from #M10620)
Updated by Mangan over 15 years ago
things like andWhere = CType IS IN LIST ('html','text') don't work either
Updated by Ries van Twisk almost 15 years ago
I did a quick test on my site using the following code:
page.20 = CONTENT
page.20.table = tt_content
page.20.select {
pidInList = this
orderBy = sorting
where = colPos=0
andWhere = header <> ''
languageField = sys_language_uid
}
And this give the expended result, no error and some data on the website.
This was tested with DBAL from SVN.
Ries
Updated by Xavier Perseguers almost 15 years ago
Hi,
I confirm that I could not reproduce the issue as stated in the description with DBAL-trunk. SQL parser has been much improved lately and as such, the problem seems to have been solved automatically.
In your note from 06.03.09, you say that
andWhere = CType IS IN LIST
does not work either. This should be
andWhere = CType IN ('html', 'text')
I did not tested this andWhere clause but I fixed IN keyword support recently and as such it should work as well. I will test this case and if it works set this bug to resolved without any change needed.
Updated by Ries van Twisk almost 15 years ago
Xavier,
the given IN clause by Mangan was indeed correct, however I think the most important part was teh first item and that is solved now.
Ries
Updated by Xavier Perseguers almost 15 years ago
Well, I don't see any "IS IN LIST" operator on
http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html
Anyway, using
andWhere = CType IN ('html', 'text')
is supported, I just tested it. Gonna close this bug.