You are here: Re: newbie wanting advice on search form « PHP Programming Language « IT news, forums, messages
Re: newbie wanting advice on search form

Posted by Jerry Stuckle on 11/24/49 11:27

wgerry wrote:
>
> //$query = 'SELECT * FROM `arrow` WHERE `Surname`LIKE \"%trimmed%\" ;
>

In addition to the other comments, this should be:

$query = "SELECT * FROM arrow WHERE Surname LIKE '%$trimmed%'" ;

The `s around the table and column name are unnecessary unless you have
a conflict with a reserved word. They don't hurt, they're just not
necessary.

However - you need single quotes around the LIKE value - and it should
be $trimmed - you forgot the '$'. Additionally, to get $trimmed to
expand, you need the whole thing in double quotes, not single (or
concatenate the strings together).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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