Reply to Re: query error

Your name:

Reply:


Posted by Satyam on 04/16/05 20:22

I believe the \ preceding the last % makes it a literal % not the wildcard %

"pete M" <pmorgan@ukds.net> wrote in message
news:20050416161150.84563.qmail@lists.php.net...
> I've got a database table with a whole list of "windows" file paths.
>
> eg
> Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Binder.lnk
> Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Excel.lnk
> Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Office
> Setup.lnk
> Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Outlook.lnk
> Advent Tower PC\C\Program Files\Microsoft Office\Microsoft PowerPoint.lnk
> Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Word.lnk
> Advent Tower PC\C\Program Files\Microsoft Office\MS Access Workgroup
> Administrator.lnk
> Advent Tower PC\C\Program Files\Microsoft Office\MSCREATE.DIR
> Advent Tower PC\C\Program Files\Microsoft Office\OF97SPEC.INI
> Advent Tower PC\C\Program Files\Microsoft Office\Office
> Advent Tower PC\C\Program Files\Microsoft Office\Office\1033
>
>
> Now I want my DB query to search for directories .. here's a sample query
> select * from ff_files
> where full_path
> like 'Advent Tower PC\C\freeserve\help\images\%'
>
> doesnt work as the % is taken as a literal '%'
>
> I've aslso tried
> like 'Advent Tower PC\\C\\freeserve\\help\\images\%'
>
> I'm completely lost ..
> all I want is to return all rows that start with
> 'Advent Tower PC\C\freeserve\help\images\'
>
> tia
> Pete

[Back to original 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

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