You are here: Re: PDO::prepare and SELECT WHERE LIKE « PHP Programming Language « IT news, forums, messages
Re: PDO::prepare and SELECT WHERE LIKE

Posted by amygdala on 06/24/87 11:56

"Alvaro G. Vicario" <webmaster@NOSPAMdemogracia.com> schreef in bericht
news:126sz4gieil98.1cjfemt8ve9pj$.dlg@40tude.net...
> *** amygdala escribi�/wrote (Wed, 23 Aug 2006 22:28:26 +0200):
>> $sql = 'SELECT name FROM ' . DB_TABLE_CITY . ' WHERE country_id =
>> :countryId
>> AND name LIKE ":city%" LIMIT 10';
>
> I've never used PDO but it seems you are using double quotes as string
> separator in SQL, and that's not correct. All SQL dialects I know use
> single quotes.
>

No, sorry, that's not it. Double quotes work fine with mysql on my system
(wamp). I tried single quotes too though (escaped in this case of course).

 

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

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