Akopia Akopia Services

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

Re: [mv] Unable to write to MYSQL database



******    message to minivend-users from Daniel Ceregatti <daniel@digitalsavant.com>     ******

I had a hell of a time doing something very similar to this yesterday. I found that...

Hans-Joachim Leidinger wrote:

> ******    message to minivend-users from Hans-Joachim Leidinger <jojo@buchonline.net>     ******
>
> Jarno Niemelä wrote:
> >
> > ******    message to minivend-users from Jarno =?iso-8859-1?Q?Niemel=E4?= <jargon@iki.fi>     ******
> >
> > Hello everyone.
> >
> > I've created an user shipping database with MYSQL,
> > and I'd like to be able to write to it from minivend
> > (from checkout.html to be precise).
> >
> > The problem is that when I try to insert into the database with
> > [sql] tag I get internal server error.
> >
> > Heres the database table I've created
> >
> > Database:minivend
> >
> > table user_shipping
> > +----------------+--------------+------+-----+---------+-------+
> > | Field          | Type         | Null | Key | Default | Extra |
> > +----------------+--------------+------+-----+---------+-------+
> > | session_id     | varchar(255) |      | PRI |         |       |
> > | shipping_name  | varchar(255) | YES  |     | NULL    |       |
> > | shipping_price | varchar(255) | YES  |     | NULL    |       |
> > +----------------+--------------+------+-----+---------+-------+
> >
> > Heres the rows that declare it in catalog.cfg
> >
> > #Shipping database
> > Database        user_shipping           user_shipping.tab       dbi:mysql:minivend:webshop:3306
> > Database        user_shipping           USER    XX
> > Database        user_shipping           PASS    XXXX
> >
> > the user_shipping.tab is an empty file, because I dont want to import
> > anything to there.
> >
> > So
> > NoImport        user_shipping
> >
> > And heres the tag that I use in trying to write to the database
> >
> > [sql type=set base=user_shipping interpolate=1]
> > replace into shipping_values
> > ('[value mv_order_number]',
> > '[value shipping-description]',
> > '[value shipping]'
> > )
> > [/sql]

...didn't work with [value name] but did work with [cgi name]...go figure. I think it depends on the context of where you are using it. In my case, it was form variables that I needed to pass to mysql, so [cgi name] worked (Although [value name] should have worked too, from what the docs state).

>
> >
> > When I load the page that has this tag, I get the standard internal server
> > error page.

tail -f /path/to/catalog/error.log

is your friend. :)

Also, enable --logs in your mysql command line in the startup script (and restart mysql, of course) and:

tail -f /path/to/mysql/your.server.name.com.log

(another good friend)

That should show you what minivend is sending to mysql.

It's also not a bad idea to tail -f /you/httpd/server/error.log

I keep 3 xterms open with those 3 tails on at all time when doing minivend, since all my carts are mysql based.

>
> >
> > I created a dummy 'products' (actually foobar) table with
> > Database .. definition in catalog.cfg so I know that the connection
> > to database works as it should.
> > But I am unable to insert anything to the database using SQL tags.
> >
> > could someone please point to my what I am doing wrong?
> >
> > Jarno Niemela

Hope this info helps.

>
>
> Hi Jarno,
>
> i am a beginner with MySQL and i want to insert new data into my sql
> data too.
> If you have the solution, can you share the solution with me?
>
> Thanks!
>
> Joachim
>
> --
> -------------Hans-Joachim Leidinger---------------------
>
> -
> 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

--

Daniel Ceregatti

Programmer - Digital Savant

Phone: (323) 848-7964 x106
Fax: (323) 871-2499
7039 Sunset Blvd., Suite 200
Hollywood, CA 90028



-
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: