turpentyne
10-10-2011, 05:06 PM
I'm trying to figure out how to pull a row that matches a search of two columns.
In other words, if they search for "bob newhart" (in one search field to keep it simple for the user). I want the query to search for bob in first names, and newhart in second names, then combine to show the result.
The query I thought would work, pulled that field, but then seemed to pull every entry after that or something like that. I only want the one row.
Here's what I tried:
"SELECT concat( first_name, ' ', last_name ) AS 'bob newhart' FROM `table`"
In other words, if they search for "bob newhart" (in one search field to keep it simple for the user). I want the query to search for bob in first names, and newhart in second names, then combine to show the result.
The query I thought would work, pulled that field, but then seemed to pull every entry after that or something like that. I only want the one row.
Here's what I tried:
"SELECT concat( first_name, ' ', last_name ) AS 'bob newhart' FROM `table`"