You are here: Re: Connecting to mysql with php « PHP Programming Language « IT news, forums, messages
Re: Connecting to mysql with php

Posted by Gary L. Burnore on 02/15/06 00:46

On Tue, 14 Feb 2006 16:44:19 GMT, "Dave Mennenoh"
<dave@blurredistinction.com.invalid> wrote:

>>>$query = select * from books where ".$searchtype." like
>>>'%".$searchterm."%'" ;
>
>Besides missing the leading quotation mark, you might like to know that you
>don't need to do concatenation like this using PHP - so you can simply do
>this:
>
>$query = select * from books where $searchtype like '%$searchterm%'" ;

You have a mismatched double quote. :)

>weird huh!

I always thought so.
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
===========================================================================

 

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

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