>Date: Sun, 11 Feb 2001 10:02:56 -0500
>To: [EMAIL PROTECTED]
>From: Bob Hall <[EMAIL PROTECTED]>
>Subject: RE: Re[2]: [PHP-WIN] php access query problem
>Cc:
>Bcc:
>X-Attachments:
>
>
>> >> I have the query
>> >> $cur= odbc_exec( $cnx, "SELECT Location, 'Dept ID', 'Equip Type' FROM
>> >> Equipment01 WHERE Location = '415C'");
>
>Sir, you have the second and third items in your SELECT clause in
>quotes, so the the SELECT statement will return the literal strings
>'Dept ID' and 'Equip Type', rather than column values.
>
>> >> which returns the proper results but when I add AND 'Equip Type' =
>>'C' to
>> >> the end of it I get no results. Is my syntax correct? Thanks, Aaron
>>
>> >> $cur= odbc_exec( $cnx, "SELECT Location, 'Dept ID', 'Equip Type' FROM
>> >> Equipment01 WHERE Location = '415C' AND 'Equip Type' = 'C'");
>
>In your WHERE clause, you are comparing the literal string 'Equip
>Type' with the literal string 'C'. Since they are not the same, the
>WHERE clause always returns FALSE, and no rows are selected.
>
>Don't put your column names in quotes. That forces the DBMS to
>evaluate them as literal strings, rather than as column names.
>
>Bob Hall
Know thyself? Absurd direction!
Bubbles bear no introspection. -Khushhal Khan Khatak
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]