Failed SQL Query

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 62739
interpreted = N
texte = I'm trying to query a MySQL database containing a table named transaction. The transaction table has numerous fields some of which are items, itemquantity, and prices. The items field contains data that looks like this: 104->123->130 This is part of a PHP shopping cart, so I can't answer questions regarding their database/table structures. The following query returns 5 records via phpMyAdmin: SELECT items,itemquantity,prices FROM transaction WHERE (items like '123->%' OR items like '%->123->%' OR items like '%->123' OR items='123') ORDER BY orderstamp; When executing the query via WebDNA's SQL contexts, I get the following error: ERROR: SQL COMMAND FAILED. COMMAND TEXT: SELECT items,itemquantity,prices FROM transaction WHERE (items like '123->%' OR items like '%->123->%' OR items like '%->123' OR items='123') ORDER BY orderstamp; ERROR TEXT: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '>14R items like '>123' OR items='123') ORDER BY orderstamp' at ERROR: COULD NOT FIND SQLRESULT "rs4". - Subsequent SQL commands attempting to use that result ID will fail. The WebDNA looks like this (with sensitive data removed): [sqlconnect dbtype=MySQL&host=216.168.63.56&database=sunshop-benelliusa&uid=NunYaBidness &pwd=NunYaBidness&conn_var=conn1][/sqlconnect] [sqlexecute conn_ref=conn1&result_var=rs4] SELECT items,itemquantity,prices FROM transaction WHERE (items like '123->%' OR items like '%->123->%' OR items like '%->123' OR items='123') ORDER BY orderstamp; [/sqlexecute] [sqlresult result_ref=rs4] [founditems] [items] | [itemquantity] | [prices]
[/founditems] [/sqlresult] ------------------------------------------------------------- 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: Failed SQL Query ( Clint Davis 2005)
  2. Re: Failed SQL Query ( Jesse Proudman 2005)
  3. Failed SQL Query ( Clint Davis 2005)
I'm trying to query a MySQL database containing a table named transaction. The transaction table has numerous fields some of which are items, itemquantity, and prices. The items field contains data that looks like this: 104->123->130 This is part of a PHP shopping cart, so I can't answer questions regarding their database/table structures. The following query returns 5 records via phpMyAdmin: SELECT items,itemquantity,prices FROM transaction WHERE (items like '123->%' OR items like '%->123->%' OR items like '%->123' OR items='123') ORDER BY orderstamp; When executing the query via WebDNA's SQL contexts, I get the following error: ERROR: SQL COMMAND FAILED. COMMAND TEXT: SELECT items,itemquantity,prices FROM transaction WHERE (items like '123->%' OR items like '%->123->%' OR items like '%->123' OR items='123') ORDER BY orderstamp; ERROR TEXT: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '>14R items like '>123' OR items='123') ORDER BY orderstamp' at ERROR: COULD NOT FIND SQLRESULT "rs4". - Subsequent SQL commands attempting to use that result ID will fail. The WebDNA looks like this (with sensitive data removed): [sqlconnect dbtype=MySQL&host=216.168.63.56&database=sunshop-benelliusa&uid=NunYaBidness &pwd=NunYaBidness&conn_var=conn1][/sqlconnect] [sqlexecute conn_ref=conn1&result_var=rs4] SELECT items,itemquantity,prices FROM transaction WHERE (items like '123->%' OR items like '%->123->%' OR items like '%->123' OR items='123') ORDER BY orderstamp; [/sqlexecute] [sqlresult result_ref=rs4] [founditems] [items] | [itemquantity] | [prices]
[/founditems] [/sqlresult] ------------------------------------------------------------- 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/ Clint Davis

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:

Bug Report, maybe (1997) Hard Questions ? (1997) [WebDNA] Error: Can't open order file. Ignoring [OrderFile] context Error: Error: expected [/APPLICATION], but found [/!] instead[/!] (2011) [WebDNA] CSS Advice (2008) [NT] ie 4.0 required (1997) Q: writefile and uploads. (1998) WebMerchant 1.6 and SHTML (1997) taxTotal, too (1997) [WebDNA] fastcgi 7+ & [cart]? (2010) taxTotal problem (1998) [WebDNA] [redirect] include a value to pass along? (2010) US Postal Service and United Parcel Service XML Lookups (2003) Images do not upload completely ... (2003) New iMac, now ... how do I make webdna serve .html files? (2005) listfields question (2005) Resume Catalog ? (1997) Examples of cross-selling with WebCatalog? (1998) DB Size - MAX (2004) forms and variables (1998) Overseas project (2000)