| Neil Smith [Mvp 2004-05-29, 12:31 pm |
| It's probably a table definition thing. Is your 'netreceipts' column an
ENUM ? How about your status column - is it a CHAR ? ENUM ? Send us the
table definition for the misbehaving table. Also, send us the error message
before asking what's the solution, we're not mind readers :-))
Your query below unless it's in some kind of pseudocode, needs quotes
around the i, vis :
WHERE status='i'
not as stated
WHERE status=i
Because 'i' is a string and must be quoted. The same happens for ENUM
columns, even though the values might appear numeric (100, 400, 500) they
must be quoted and treated like strings, as they are not internally
numbers, but indexes into a list of strings. In the same way, you can
return the index directly by asking for status+0 which converts the status
index into a number rather than returning the string '100' you will get the
number 1 (which is useful when creating checkboxes from ENUMs)
HTH
Neil
At 14:36 29/05/2004 +0000, you wrote:
>To: "php-db@lists.php.net" <php-db@lists.php.net>
>From: kc68@cornell.edu
>Content-Type: text/plain; format=flowed; charset=iso-8859-15
>MIME-Version: 1.0
>Content-Transfer-Encoding: 8bit
>Date: Sat, 29 May 2004 10:35:40 -0400
>Message-ID: <opr8rmtquuwxq73o@smtp.comcast.com>
>Subject: "Where" Error
>
>This should be ultimately simple; it just doesn't work. I want to limit
>display to rows from a single table in which the status column contains
>i. Only options are i, c, o. After the select line I have "where status
>= i" (no quote marks). I get an error message to the "while" line that
>calls the table.
>
>When I limit by another column "where netreceipts > 500" I get the desired
>result. When I change it to "where netreceipts = 500" (and there is a
>500) I get the error message above.
>
>What's the solution?
>
>Ken
========================================
================
CaptionKit http://www.captionkit.com : Production tools
for accessible subtitled internet media, transcripts
and searchable video. Supports Real Player, Quicktime
and Windows Media Player.
VideoChat with friends online, get Freshly Toasted every
day at http://www.fresh-toast.net : NetMeeting solutions
for a connected world.
|