Can't take Pis of the database you have, can anyone help?

0 like 0 dislike
38 views
'id' => new Expression('(SELECT COUNT(`id`) FROM ' . $this->getTable() . The ' WHERE `ip` = INET_ATON(' . "$ip" . '))', []),


ERROR

Statement could not be executed (42000 - 1064 - 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 '.0.1)) AS `id` FROM `survey_vote` at line 1)
by | 38 views

2 Answers

0 like 0 dislike
Print the generated text of your request, locate the specified error location and take a look.
The decision
INET_ATON accepts a string as an input.
by
0 like 0 dislike
When applying aggregate functions to a field, then if you want this field to access by name, you need to specify an alias for a field, for example:
select count(id) as id from
by

Related questions

0 like 0 dislike
7 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked Jun 9, 2019 by VoisHunter
110,608 questions
257,187 answers
0 comments
40,796 users