salad <oi*@vinegar.com> wrote in
news:3h*****************@newsread1.news.pas.earthl ink.net:
David W. Fenton wrote: salad <oi*@vinegar.com> wrote in
news:oh***************@newsread2.news.pas.earthlin k.net:
David W. Fenton wrote:
salad <oi*@vinegar.com> wrote in
news:PM****************@newsread1.news.pas.ear thlink.net:
>Lorenzo Thurman wrote:
>
>>I'm connecting to an access database and I would like the
>>query to return results grouped on a particular column. When I
>>try the following query, I get this error back from PHP:
>>DB Error: syntax Error
>>
>>"SELECT * FROM HardwareInstallationsSummary WHERE LocationID =
>>$loc_ID GROUP BY Manufacturer"
>>
>>Iposted this question on a PHP list and someone there
>>suggested that SQl does not allow this to happen unless its
>>part of an aggregate statement. Is this true? Is there a way
>>around this? TIA
>
>It's possibe the $loc_id is not being parsed as its value.
You obvioiusly know nothing about PHP.
That is correct. Neither do the people on the PHP list. It
appears Rick Wannal spotted the error.
No, the error was a Jet SQL error, not a PHP error.
No. The error was a programmer error. It was a PHP error because
there was a Jet error that existed because of programmer error.
Rick Wannal spotted the programmer error that will fix the Jet
error that will not be result in a PHP error.
The PHP part of the code was correct. It would have produced no
error had the SQL been correct.
It was not a PHP error -- it was PHP reporting an error that came
from the ODBC driver.
Calling it a "programmer error" is ludicrous, since had it been a
PHP syntax error or a SQL error, it would still have been typed by
the programmer involved.
My point in drawing this out is that the answers that suggested
treating the construction of the dynamic SQL string the same way you
would do it in VBA were ignorant of the way PHP parses variables
inline in strings, and missed the point entirely.
--
David W. Fenton
http://www.dfenton.com/
usenet at dfenton dot com
http://www.dfenton.com/DFA/