Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] sql query gives "Bad SQL" error



******    message to minivend-users from "Christian J. =?iso-8859-1?Q?M=FCller?=" <cmueller@polinet.ch>     ******

Hi Scott,

I was the one who complained about the [query] tag... However, it now
works for me with MV 4.01.

At first glance, I see the following:

Scott Lewis wrote:
> 
> ******    message to minivend-users from "Scott Lewis" <lists@balticave.com>     ******
> 
> hi,
> 
> i'm new to minivend and having a hard time integrating it with
> mysql. i have a test table and when the catalog starts the table
> is successfully read in from a text file and the mysql table
> created. i can read data from the table with the [data] and
> [loop search] tags, but i can't make [query] work.
> 
> the query works from the mysql client. and it works from a perl
> program using the same DSN. is this a bug with the [query]
> tag? i am using MiniVend 4.01, which was supposed to fix a
> bug in [query].
> 
> or, is there another tag i can use to get data from an
> arbitrary SQL statement?
> 
> any help would be greatly appreciated.
> 
> -scott
> lists@balticave.com
> 
> these are the entries in the catalog cfg file:
> 
> Database        testa   testa.txt       dbi:mysql:store_db
> Database        testa   USER    [my username]
> Database        testa   PASS    [my password]
> Database        testa   DELIMITER       TAB
> Database        testa   KEY     code
> Database        testa   COLUMN_DEF      "code=char(16) NOT
> NULL PRIMARY KEY"
> Database        testa   COLUMN_DEF      "name=char(128)"
> 
> this tag fails with an error of "Bad SQL":
> 
> [query  sql="select code, name from testa"]

I think you need a list=1 arg in the query to get a list output.

> [sql-data testa code]<BR>

You need [sql-code] and [sql-param field] to list the field contents.

> [/query]

This does not explain the BAD SQL error message, but I suggest that you
try the proposed changes and then see whether the error persists. (step
by step)

Does the query look Ok in the mysql log? (start server with safe_mysqld
-l).

Chris


> 
> -
> To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
> email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
> Archive of past messages: http://www.minivend.com/minivend/minivend-list
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: