Now then, let's all play nicely together!
It is a PHP question because whereas the SQL query SELECT fred FROM tbl
produces an array element back in PHP such as $row[ "fred" ], this
convention/mapping comes well unstuck if you submit something like SELECT IF
( answer = 'a', TRUE, FALSE )... or even SELECT fred+barney... Accordingly
the need to create an alias column name (Answer-A) and thereafter in PHP to
access the returned data with something like $row[ "Answer-A" ].
Tyler: appreciation and politeness
I thought this looked familiar, and it is part of something I sent to you 36
hours ago to perform cross-totalling on a survey or exam results type
database. Since then there has been no comment from you, except to others.
If the suggestion doesn't work, please have the courtesy to come back to me,
at least by cc:, for correction or amplification. NB If you had tested it at
the MySQL (?) command line or using a management tool (recommended testing
procedure before implementing in PHP), then you would have observed the
Dan is often here, being helpful. Did you really mean to irritate two people
by thoughtlessness if not deed, during the course of a single conversation?
> Why not just let such a simple question go then? Especially since your
> is also off topic? Also, the question I asked was part of a reply from a
> previous topic. Thanks to all who answered my "simple" question. It is
> greatly appreciated.
> >On Mon, Aug 12, 2002 at 02:15:23PM +0000, Tyler Durdin wrote:
> > > SELECT *, IF (answer = 'a', TRUE, FALSE) AS Answer-A
> > > What does the As Answer-A mean and what does it do?
> >Why not examine the manual for the answer to such a basic question,
> >especially one that is off topic for the list you posted to?
> >Assuming you're using MySQL read http://www.mysql.com/doc/en/SELECT.html
> >and you'll quickly come across the meaning of AS.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php