Thanks.

Looking at the first attempt, the error is clear: you're passing one bind value (a string containing comma-separated values), and it's expecting 4 bind values (a list of the 4 values, instead of the string).

In the second attempt, sending @values to execute(), the first problem does not occur- you successfully execute with the list of 4 @values that crashed the first example. Instead, you have another problem further along:

-> execute for DBD::mysql::st (DBI::st=HASH(0x81f9c2c)~0x81f9bf0 '160' + '1168280448' '10081' '15' '0' '2002-03-31 23:08:31-05' '0' '' '1' '0 +' 'undef') -> dbd_st_execute for 081f9bfc Binding parameters: INSERT INTO basket VALUES ('160',1168280448,10 +081,'15',0,2002-03-31 23:08:31-05,0,,1,0,undef) You have an error in your SQL syntax near '23:08:31-05,0,,1,0,undef)' +at line 1 error 1064 recorded: You have an error in your SQL syntax n +ear '23:08:31-05,0,,1,0,undef)' at line 1
This is a little bit weird- it looks like the execute() statement isn't correctly quoting your date. The insert statement doesn't have quotes around the date. Most likely SQL is interpreting 2002-03-31 as a subtraction of 3 integers, and then getting confused when it gets to the 23:08:31-05.

I'd try manually quoting the date "2002-03-31 23:08:31-05" before sending it in as an execute() value. Unfortunately, it's not obvious where this can be done in your code.

Alan


In reply to Re: Re: Re: DBI::mysql by ferrency
in thread DBI:mysql by Dalin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.