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 likethis:104->123->130This is part of a PHP shopping cart, so I can't answer questions regardingtheir 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 BYorderstamp;When executing the query via WebDNA's SQL contexts, I get the followingerror:ERROR: SQL COMMAND FAILED.COMMAND TEXT: SELECT items,itemquantity,prices FROM transaction WHERE (itemslike '123->%' OR items like '%->123->%' OR items like '%->123' ORitems='123') ORDER BY orderstamp;ERROR TEXT: You have an error in your SQL syntax. Check the manual thatcorresponds to your MySQL server version for the right syntax to use near'>14R items like '>123' OR items='123') ORDER BY orderstamp' at ERROR: COULDNOT 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 BYorderstamp;[/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:
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 likethis:104->123->130This is part of a PHP shopping cart, so I can't answer questions regardingtheir 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 BYorderstamp;When executing the query via WebDNA's SQL contexts, I get the followingerror:ERROR: SQL COMMAND FAILED.COMMAND TEXT: SELECT items,itemquantity,prices FROM transaction WHERE (itemslike '123->%' OR items like '%->123->%' OR items like '%->123' ORitems='123') ORDER BY orderstamp;ERROR TEXT: You have an error in your SQL syntax. Check the manual thatcorresponds to your MySQL server version for the right syntax to use near'>14R items like '>123' OR items='123') ORDER BY orderstamp' at ERROR: COULDNOT 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 BYorderstamp;[/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:
Setting up shop (1997)
WebCatalog Technical Reference (1997)
Credit card types (1997)
Changing price for a SLU based on options (size, etc.) (1997)
emailer (1997)
Max Record length restated as maybe bug (1997)
Saving/Looking Up customer numbers (1998)
WCf2 and nested tags (1997)
Getting total number of items ordered (1997)
[WriteFile] problems (1997)
problems with WebCat-Plugin (1997)
Re:2nd WebCatalog2 Feature Request (1996)
FREE Web Server Monitor FREE (1997)
Format all of a sudden doesn't work (1997)
Web Catalog 2 demo (1997)
Help formatting search results w/ table (1997)
RE: WebCatalog NT beta 18 now available (1997)
OS X permissions to write to Globals directory (2003)
WebCatalog for guestbook ? (1997)
RAM variables (1997)