Re: Problem with string comparison

From: Date: Thu, 13 Mar 2003 22:36:33 +0000
Subject: Re: Problem with string comparison
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-139616@lists.php.net to get a copy of this message
At 23:11 13.03.2003, Charles Kline said: --------------------[snip]-------------------- >On Thursday, March 13, 2003, at 05:08 PM, Ernest E Vogelsinger wrote: > >> - if your query is exactly as you sent it here you're missing a comma >> after >> the closing bracket of "concat()", just before "name" > >name is supposed to be an alias for the concatenated values of >fname,lname,mname. then shouldn't that be something like this? (at least with PostgreSQL it would): $sql = "SELECT id, concat(fname, ' ', lname, ' ', degree1) as \"name\"". " FROM tbl_personnel WHERE name LIKE '%" . $attributes['nametofind'] . "%' ORDER BY lname ASC"; I just saw that there's another quote just before WHERE that may throw your code off. >Let me try to say what I am trying to do. I have a table of people and >have the names saved in fields: fname, lname, mname. I want to have a >search field where the user can find a persons record by typing in all >or part of their name. What would this kind of query look like? I'd say you're right on track... -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#139616) next »