You are here: Re: Query Question « All PHP « IT news, forums, messages
Re: Query Question

Posted by Malcolm Dew-Jones on 05/28/05 07:18

Chris (coverland914@yahoo.com) wrote:
: What wonderful code - talk about slick... :-) don't quite understand
: what the "from table where 1 = 1" is doing (the business with the '1'
: but it sure works great - thanks so much...


WHERE 1 = 1 (i.e. where one equals one)

is always true.

It is the same as having no where clause, except that you can append
something like

" AND name='fred' "

and the statement will still work.

WHERE 1 = 1 AND name='fred'


Otherwise you need to worry about adding the WHERE clause and when to add
the AND.

It is a useful idiom, nothing more.

--

This space not for rent.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация