Closed hirdeshvishwdewa closed 3 years ago
$data = array(); $data['tableName'] = "users"; $data['selectFields'] = array('count(*)(count)'); // OR $data['selectFields'] = 'count(*)(count)'; $data['where'] = array('OR' => array('email[=]' => $user['email'], 'username[=]' => $user['username'])); $medoo = new medoo($this->db); $medoo->select($data['tableName'], $data['selectFields'], $data['where'])
I want count as an alias of count(*), which I am not getting, instead I am getting a empty result.
This is the sql generated from debug mode.
SELECT AS count FROMusersWHERE email = 'hir@ha.com' OR username = 'hird08A'
SELECT AS count FROM
WHERE email = 'hir@ha.com' OR username = 'hird08A'
Please fix :)
I have the same problem with group by. I change the code like this.
$value = preg_replace('/^#.(\)\s/i', "", $value); $stack[ $index ][ $value ] = $data[ $value ];
I want count as an alias of count(*), which I am not getting, instead I am getting a empty result.
This is the sql generated from debug mode.
SELECT AS count FROM
usersWHERE email = 'hir@ha.com' OR username = 'hird08A'
Please fix :)