Response to a request with verification of the section "Parsing and resolving function names" in the Reference Guide

Can someone please explain to me what is wrong with this?

SELECT COUNT (`ID`) FROM `tableImSpecifying` WHERE `VisitorsEmail` = '$VarThatHoldsEmailFromA$_POSTInput'

This is part of the program that I write following the tutorial, but I hung up how to fix it. I would be very grateful, and I thank you in advance if someone tells me how to fix this.

Here's the error I see:

FUNCTION myhost_classifieds.COUNT does not exist. Check the "Parsing and resolving function names" section in the Reference Guide

What puzzles me, I have similar queries above this that work correctly, and I checked the syntax again and again, but I don’t see what is wrong.

+6
source share
5 answers

It:

FUNCTION myhost_classifieds.COUNT does not exist. Check the "Parsing and resolving function names" section in the Reference Guide

- :

COUNT (`ID`)

To:

COUNT(`ID`)

( ).

( IGNORE_SPACE, .

+16

:

SELECT COUNT (`ID`) 

SELECT COUNT(`ID`) 

.

+7

try it

 SELECT COUNT(`ID`) FROM `tableImSpecifying` WHERE `VisitorsEmail` = '$VarThatHoldsEmailFromA$_POSTInput'
            ^^-------remove space here
+1
source

I also ran into the same problem while executing a request

SELECT MIN (released_year) FROM books

where i ran into an error

FUNCTION records.MIN does not exist.
Check the 'Function Name Parsing and Resolution' section in the Reference Manual.  

But this worked when I removed the space between MIN and (release_year), so the correct one:

SELECT MIN(released_year) FROM books
+1
source

MYSQL doesn't like the space after function names. Try to extract space after COUNT.

I also believe that these variable names are just an example, and you don't actually use them in production!

0
source

All Articles