7 messages in com.mysql.lists.mysqlRe: Query help
FromSent OnAttachments
Chuck Barnett04 Apr 2002 08:27 
Rick Emery04 Apr 2002 09:05 
Chuck Barnett04 Apr 2002 09:20 
Rick Emery04 Apr 2002 09:48 
Luc Foisy04 Apr 2002 10:26 
John Klein04 Apr 2002 10:33 
Lance Uyehara04 Apr 2002 11:16 
Subject:Re: Query help
From:John Klein (zar@law.harvard.edu)
Date:04/04/2002 10:33:16 AM
List:com.mysql.lists.mysql

art_@bellsouth.net wrote:

This will not work for my example. I have a select box that was populated from the db with firstname lastname. The option tag has the value of firstname+lastname then. Here lies the problem, when I build the query, I have no way of distinguishing firstname and lastname.

There are two ways to solve this problem. One is to build your select box differently, so that it passes the data as firstname/lastname or firstname|lastname or with some other delimiter, then split the data before entering/examining it.

If you're stuck with the current behavior, though, try: select [fields] from [table] where concat([firstname],[lastname]) is [value];