PDA

View Full Version : Store-related logic problem...



zquirm
25 Mar 2007, 1:24 PM
Ok, here's my problem.

I have a database of people with first_name, last_name, and email columns. I have connected a search combobox to this database the same way Jack has done so in his Live Search example.

From what I can tell, the parameter "query", that being my complete string that I've typed, is sent the server via HttpProxy.

I have no problem if just a first or last name is typed, b/c I can use SQL LIKE to compare. But if they type the whole name, I lose my ability to filter server-side.

If I had access to the database, I'd add a "name" column that puts the first and last name together, but I can't.

suggestions?

tryanDLS
26 Mar 2007, 9:28 AM
This completely unrelated to Ext, it's up to you figure out how to parse/interpret the data passed to the server. At a mimimum, you could do a query
Select * from table where firstname + ' ' + lastname = 'query'

You can't just pass what they entered into your SQL statement without parsing it, so you might as well put some intelligence into the server process. What if they enter ';drop table users;go;' into the search field?