Reputation:
Would someone please explain to me what is wrong with this??
SELECT COUNT (`ID`) FROM `tableImSpecifying` WHERE `VisitorsEmail` = '$VarThatHoldsEmailFromA$_POSTInput'
This is part of a program I am writing while following a tutorial but I'm hung up on how to fix this. I'd be most appreciative and I thank you in advance if anyone can tell me how to fix this.
Here's the error I'm seeing:
FUNCTION myhost_classifieds.COUNT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
What baffles me is I have similar queries above this one that work properly and I've checked the syntax over & over but I don't see what's wrong.
Upvotes: 11
Views: 36650
Reputation: 131
In simple terms, according to Wrikken, on the SQL Manual it says,
To use the name as a function call in an expression, there must be no whitespace between the name and the following ( parenthesis character.
So the expression,
SELECT COUNT (`ID`) FROM `tableImSpecifying` WHERE `VisitorsEmail` = '$VarThatHoldsEmailFromA$_POSTInput'
doesn't work because there is a whitespace between COUNT and the ( ). Simply remove the whitespace and change it to:
SELECT COUNT('ID') ...
Upvotes: 8
Reputation: 51
I also encountered the same problem while running the query
SELECT MIN (released_year) FROM books
where i encountered the error
FUNCTION records.MIN does not exist.
Check the 'Function Name Parsing and Resolution' section in the Reference Manual.
But it worked when i removed the space between MIN and (released_year) so the correct one is:
SELECT MIN(released_year) FROM books
Upvotes: 1
Reputation: 1
MYSQL doesn't like white space after function names. Try taking out the space after COUNT.
I also take it that those variable names are just an example and your not actually using them in production!
Upvotes: 0
Reputation: 70520
This:
FUNCTION myhost_classifieds.COUNT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
Would prompt you to read this
Which leads you to alter this:
COUNT (`ID`)
To:
COUNT(`ID`)
(note the removed space).
(you could also fiddle around with IGNORE_SPACE
, but I wouldn't recommend it for a novice.
Upvotes: 30
Reputation: 37253
try this
SELECT COUNT(`ID`) FROM `tableImSpecifying` WHERE `VisitorsEmail` = '$VarThatHoldsEmailFromA$_POSTInput'
^^-------remove space here
Upvotes: 1
Reputation: 72985
Change:
SELECT COUNT (`ID`)
to
SELECT COUNT(`ID`)
The space is messing it up.
Upvotes: 14