Re: MySQL Wildcard Trouble

This WebDNA talk-list message is from

2006


It keeps the original formatting.
numero = 67345
interpreted = N
texte = Sorry, typo - try this: example: SELECT * FROM states WHERE State LIKE '%Alask%'; This is what I do: [!]--Clean values of illegal chars--[/!] [table name=IllegalChars&Fields=From,To] %,%% \,\\ ','' [/table] [!]--Search for keyword database table--[/!] [SQLExecute conn_ref=conn1&result_var=rsEx] SELECT state FROM ex.states WHERE searchState LIKE '%%[convertchars table=illegalchars][QS][/convertchars]%%'; [/SQLExecute] [SQLResult result_ref=rsEx] [founditems] [state] [/founditems] [/SQLResult] Adam O'Connor wrote: > Try: > > LIKE %%YourColumn%% > > > > > > Matthew Bohne wrote: >> Build the search string first... >> >> [text show=f]strQuery=[url]"SELECT * FROM Classifieds WHERE AdText >> LIKE '%[/url][_textstring][url]%'"[/url][/text] >> >> then search using [unurl][strQuery][/unurl]... Or try it without the >> url/unurl combo. >> >> >> >> Sam McConnell wrote: >>> Hello, >>> >>> I'm having a bit of trouble with WebDNA and MySQL. I need to query a >>> table in the database where the text field matches a search. The >>> problem I'm having is that WebDNA doesn't work with the wildcard >>> syntax. >>> >>> Basically, I'm trying to do "SELECT * FROM Classifieds WHERE AdText >>> LIKE '%[_textstring]%'", but "%" seems to cause an error with >>> WebDNA. If I take out the "%", the query works. >>> >>> Thanks >>> >> >> >> ------------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> To switch to the DIGEST mode, E-mail to >> >> Web Archive of this list is at: http://webdna.smithmicro.com/ > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: MySQL Wildcard Trouble ( Adam O'Connor 2006)
  2. Re: MySQL Wildcard Trouble ( Adam O'Connor 2006)
  3. Re: MySQL Wildcard Trouble ( Sam McConnell 2006)
  4. Re: MySQL Wildcard Trouble ( Adam O'Connor 2006)
  5. Re: MySQL Wildcard Trouble ( Matthew Bohne 2006)
  6. MySQL Wildcard Trouble ( Sam McConnell 2006)
Sorry, typo - try this: example: SELECT * FROM states WHERE State LIKE '%Alask%'; This is what I do: [!]--Clean values of illegal chars--[/!] [table name=IllegalChars&Fields=From,To] %,%% \,\\ ','' [/table] [!]--Search for keyword database table--[/!] [SQLExecute conn_ref=conn1&result_var=rsEx] SELECT state FROM ex.states WHERE searchState LIKE '%%[convertchars table=illegalchars][QS][/convertchars]%%'; [/SQLExecute] [SQLResult result_ref=rsEx] [founditems] [state] [/founditems] [/SQLResult] Adam O'Connor wrote: > Try: > > LIKE %%YourColumn%% > > > > > > Matthew Bohne wrote: >> Build the search string first... >> >> [text show=f]strQuery=[url]"SELECT * FROM Classifieds WHERE AdText >> LIKE '%[/url][_textstring][url]%'"[/url][/text] >> >> then search using [unurl][strQuery][/unurl]... Or try it without the >> url/unurl combo. >> >> >> >> Sam McConnell wrote: >>> Hello, >>> >>> I'm having a bit of trouble with WebDNA and MySQL. I need to query a >>> table in the database where the text field matches a search. The >>> problem I'm having is that WebDNA doesn't work with the wildcard >>> syntax. >>> >>> Basically, I'm trying to do "SELECT * FROM Classifieds WHERE AdText >>> LIKE '%[_textstring]%'", but "%" seems to cause an error with >>> WebDNA. If I take out the "%", the query works. >>> >>> Thanks >>> >> >> >> ------------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> To switch to the DIGEST mode, E-mail to >> >> Web Archive of this list is at: http://webdna.smithmicro.com/ > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Adam O'Connor

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

same products but different (1998) Math, Multiple Equasions and Show/Hide (1998) WebCatalog/Mac 2.1b2 - PIXO (1997) text size limitation (1997) anyone interested in doing an open-source WebCat basedforum? (2002) Newbie Question about seeting price to 0 (1998) Gift Certificates? Any one have suggestions? (2000) Dubble Sku's in a Database (1999) Summing fields (1997) Viewing Changes (1998) emailer settings and control questions (1997) Random ads (1998) Grouping fields problem (1998) Sorting error (1997) Feedback on new features (2000) Alternative To WebDNA? (2006) What am I missing (1997) WebCatalog2 Feature Feedback (1996) [CART] inside a [LOOP] (1997) Help with Shipping Costs (1997)