Hi I am trying a Select with the MDB Query tool on a mysql
database and
getting some problems with the generated Sql Query.
$query=new MDB_QueryTool(DSN,NULL,2);
$query->setOption('raw',true);
$query->setSelect("calls_id,
project_id,submissionstage_id,
status.statustext,status_id, COUNT( status_id ) AS anzahl,
GROUP_CONCAT(DISTINCT review.country_id order by
country.countrycode ASC
SEPARATOR ',') as reviewed_countries_ids");
$query->setTable("review");
$query->setLeftJoin("status","status_id=
status.id");
$query->setWhere("calls_id=3");
$query->setGroup("status_id,
project_id,submissionstage_id");
$query->useResult('array');
print_r($query->_buildSelectQuery($query,true));
print_r($query->getQueryString());
the problem is the group concat
the generated part in the sql is:
GROUP_CONCAT(DISTINCT review.`country_id order by
country`.countrycode ASC
SEPARATOR ',`')` AS reviewed_countries_ids
expected:
GROUP_CONCAT( DISTINCT country.countrycode order by
country.countrycode ASC
SEPARATOR ',') as reviewed_countries
or with quotes
GROUP_CONCAT( DISTINCT country.`countrycode` order by
country.`countrycode`
ASC SEPARATOR ',') as reviewed_countries
Is there an option to set the tool to disable quoting?
i thought $query->setOption('raw',true); enables this,
but sadly no :(
thx in advance
--
View this message in context: http:/
/www.nabble.com/Problem-with-MDB_QueryTool-and-quoting-a-gro
upconcat-select-tf3906360.html#a11075264
Sent from the Pear - Dev mailing list archive at
Nabble.com.
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|