Jump to content

strange GROUP_CONCAT problem


mabog

Recommended Posts

When adding GROUP_CONCAT to the query, row count is:

Showing rows 0 - 0 (1 total, Query took 0.0224 sec)

Without GROUP_CONCAT:

Showing rows 0 - 4 (5 total, Query took 0.0215 sec)

 

So in the first case mysql_num_rows() doesn't work anymore EVEN query result (via PHPMySQL) is OK!

 

Why row count is zero??

Link to comment
https://forums.phpfreaks.com/topic/194742-strange-group_concat-problem/
Share on other sites

Really? You asked mysql to group everything into a single record -- and it did -- so why are you blaming a function?

 

It's not a single record, it's 5 rows, in both cases. But with GROUP_CONCAT row count is zero even rows are visible!

Anyway I solved this with second query and with simple php comparison.

But still "1 total".

 

Which is incorrect because there was more than 1 row.

 

But I tested that query again, with / without group_concat:

Without: Showing rows 0 - 7 (8 total, Query took 0.0218 sec), 8 rows visible

With: Showing rows 0 - 0 (1 total, Query took 0.0220 sec), 8 rows visible

 

??

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.