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/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to