Now you have found the problem by your own means I can divulge the means of diagnosis I was prodding you toward in the CB. The reason you were unable to diagnose the problem was that you are taking too many shortcuts in this code: an error in another part of your application is trickling down and manifesting itself as an error in this line of code because you havent taken steps to prevent this from happening. The first step I would have taken upon getting an error from this code (assuming I would have written it like this in the first place) would be to split it into convenient chunks so each part can be examined separately, so to start:

my $create_args = {'show' => $q->param('title'), 'password' => $q->param('passw +ord'), 'gamertag' => $q->param('gamer +tag'), 'locations' => $q->param('loca +tions'), 'episodes' => $q->param('episo +des'), 'character' => $q->param('char +acters'), 'description' => $q->param('de +sc'), 'datetime' => Class::Date->now +(), }; Jonbaglo::Database::Clan_Shows->create($create_args);
At this point you will still get the same error at the same point, but now you are able to examine $create_args using say Data::Dumper before you try to use it. You could do for instance:
warn Dumper($create_args);
which should put the data structure in your error log. At this point you would have realized that you were getting a funny data structure and that the probable cause was that some or all of the parameters you were trying to use were undefined.

You should have been checking the parameters before you were trying to use them in the first place, not just to stop errors like this in your code, but also to prevent your application being exploited by faulty or malicious input.

/J\


In reply to Re: Sql Issues blank column being called which isnt in the code? by gellyfish
in thread Sql Issues blank column being called which isnt in the code? by barrycarlyon

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.