Query Responds With Check the 'Function Name Parsing and Resolution' section in the Reference Manual

后端 未结 6 497
终归单人心
终归单人心 2020-12-19 02:22

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

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


        
相关标签:
6条回答
  • 2020-12-19 02:51

    Change:

    SELECT COUNT (`ID`) 
    

    to

    SELECT COUNT(`ID`) 
    

    The space is messing it up.

    0 讨论(0)
  • 2020-12-19 02:51

    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!

    0 讨论(0)
  • 2020-12-19 02:53

    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
    
    0 讨论(0)
  • 2020-12-19 03:05

    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.

    0 讨论(0)
  • 2020-12-19 03:11

    try this

     SELECT COUNT(`ID`) FROM `tableImSpecifying` WHERE `VisitorsEmail` = '$VarThatHoldsEmailFromA$_POSTInput'
                ^^-------remove space here
    
    0 讨论(0)
  • 2020-12-19 03:12

    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') ...
    
    0 讨论(0)
提交回复
热议问题