List Info

Thread: Problem with MDB_QueryTool and quoting a groupconcat select




Problem with MDB_QueryTool and quoting a groupconcat select
user name
2007-06-12 03:51:27
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


Re: Problem with MDB_QueryTool and quoting a groupconcat select
user name
2007-06-12 07:52:01
solved, I saw a bug request thats said that this is fixed in
the csv version.
this was on february 2007 thought i have this version if i
install the
classes now and not the older version.

-- 
View this message in context: http:/
/www.nabble.com/Problem-with-MDB_QueryTool-and-quoting-a-gro
upconcat-select-tf3906360.html#a11078259
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


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )