The query is:
SELECT COUNT (*) FROM Production AS p LEFT OUTER JOIN Estimates ON
p.EstId=Estimates.EstId WHERE p.DocketNumber=20227
When I enter literally this query into PHPMySQLAdmin, it executes and gives me a result. When I enter this query into PHP code, it brings up an error. There is no problem connecting to the database, because when I remove COUNT and the brackets around *, the query executes.
Is this an issue with mysql and conflicts with the count command?
EDIT: nvm
MySQL has an option for whether to accept
COUNT (*)or whether to insist that there be no space. This option can be set per database connection, so it might be set differently in your phpMyAdmin connection versus your PHP connection.So
SELECT COUNT (*) ...might be an error or not, depending on the SQL mode. It’s usually more correct to useSELECT COUNT(*) ...without the space afterCOUNT.See Function Name Parsing and Resolution for more details.