View Issue Details

IDProjectCategoryView StatusLast Update
0015454phpList 3 applicationGeneralpublic19-05-15 17:23
Reportercmacsound Assigned To 
Status resolvedResolutionfixed 
Product Version2.10.12 
Target Version2.10.13Fixed in Version2.10.14 
Summary0015454: database error 1064 when stacking attributes in 2.10.12
Descriptionresurfaced comma syntax error in version 2.10.12 when stacking attributes. previous clean-comma patches not helping. Using Firefox 3.6.3. mySQL 5.0.90-community-log.

"Database error 1064 while doing query You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2)' at line 3"

Existing criteria
City/Region is , 2 remove
TagsNo tags attached.


related to 0015283 resolveduser4540 phpList 3 application v2.10.10: Date criteria does not work 
related to 0009983 resolvedmichiel phpList 3 application parentheses missing in sql statements in stacked criteria code, send_core.php 
related to 0015182 resolvedmichiel phpList 3 application Error 1064 when using stacked attribute selection 
related to 0015301 resolvedmichiel phpList 3 application function UserAttributeValue will end up with no value in $val_ids[0] causing sql command to fail 
related to 0015211 resolvedmichiel phpList 3 application STACKED_ATTRIBUTE_SELECTION "," error on values 
related to 0015565 new phpList 3 plugins Incorrect record selection in Stacked Criteria 



24-04-10 08:25

reporter   ~0050966

...also appears that attribute value criteria is not saving properly when stacked attribute is disabled...


24-04-10 14:41

manager   ~0050967

I can confirm this issue on my 2.10.12 install. While criteria selection seems to work fine with 'date' attributes, when using the 'select' type attribute generates a database error 1064.

Existing criteria operator values
Date of birth is before 10-04-2010, 0
Preferred color is , 1

System details:
    * phplist version: 2.10.12
    * PHP version: 5.2.3
    * Browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100401 Firefox/3.6.3
    * Webserver: Apache/1.3.37 (Unix) PHP/5.2.3 mod_ssl/2.8.28 OpenSSL/0.9.8a mod_perl/1.29 FrontPage/
    * Mysql Info: 4.1.12-standard-log
    * PHP Modules: libxml, xsl, xmlwriter, dom, xmlreader, xml, tokenizer, session, pcre, SimpleXML, SPL, PDO, sockets, SQLite, standard, Reflection, posix, pdo_sqlite, pdo_mysql, mysql, mhash, mcrypt, mbstring, json, imap, iconv, hash, gettext, gd, ftp, filter, exif, date, curl, ctype, calendar, bcmath, zlib, openssl, apache, Zend Optimizer


27-04-10 17:03

manager   ~0050972

Same issue when using 'radio' type attributes. though it seems to work fine with 'date' type and 'checkboxgroup' type attributes.

Can also be reproduced on the online demo (currently running v2.10.11).


01-06-10 04:08

manager   ~0051028

jfquestiaux suggests this (temporary) fix:

==== Start Quote ====
Since I upgraded to version 2.10.12, I have a bug (confirmed in Mantis) when it comes to select criteria to choose users to send to.

There is a syntax error beacause of a "," added in front of the criteria.

The culprit is the "cleanCommaList" function in the admin/connect.php file.

To correct that, uncomment the "old" cleanCommaList function (on line 1132) and comment out the "new one" (lines 1136 - 1145), or fix the code (and share the solution) if your skills allow to.
===== End Quote =====

Reverting to the old cleanCommaList function appears to fix this on my system too.

For those needing more detailed instructions: In lists/admin/connect.php, starting from line 1132,
change this:

#function cleanCommaList($list) {
# return join(',',cleanArray(split(',',$list)));

function cleanCommaList($sList) {
  if (!strpos($sList,',')) return $sList;
  $aList = explode(',',$sList);
  foreach ($aList as $key=>$value) {
    if(!$value) {
       array_splice($aList, $key, 1); //Remove null value from array
  return join(',',$aList);

To this:

function cleanCommaList($list) {
  return join(',',cleanArray(split(',',$list)));

#function cleanCommaList($sList) {
# if (!strpos($sList,',')) return $sList;
# $aList = explode(',',$sList);
# foreach ($aList as $key=>$value) {
# if(!$value) {
# array_splice($aList, $key, 1); //Remove null value from array
# }
# }
# return join(',',$aList);


28-04-11 16:47

administrator   ~0051182