G'day Bod,

This sounded familiar. I dug up "Recalcitrant placeholders" which uses selectrow_array() and includes:

"Yet my code returns 0."

I started to look through this but it's very long: I'll leave you to revisit and review.

I did note that you showed a workaround (which, perhaps, might also be applicable here):

my $query = $crm->db->prepare("SELECT idPerson FROM Person WHERE email + = ? OR altEmail = ?"); $query->execute($data{'email'}, $data{'email'}); my $crid = $query->fetchrow_array; print "ERROR: " . $crm->db->errstr if $crm->db->err;

Your post contains unknown functions. You haven't shown the output of your print statements. The code is not self-contained: it's impossible to run this to troubleshoot.

The only thing that leaps out at me as being a potential problem is:

my $point = "POINT( $data{'lng'} $data{'lat'} )";

$point will end up as something like: 'POINT( arg1 arg2 )'. Should there be comma between the two arguments? Did you really want a string here? Have you quoted it correctly?

As requested for that similar post from nine months ago, please provide an SSCCE. My reply to that contained an SSCCE which might be a useful example (or, at least, a starting point for one): "Re: Recalcitrant placeholders".

Update: I started composing my reply before "Solved! (was: Re: DBI returns zero!)" was posted; but clearly posted my reply a short time afterwards. Glad to see I was on the right track with reference to "Recalcitrant placeholders". :-)

— Ken


In reply to Re: DBI returns zero! by kcott
in thread DBI returns zero! by Bod

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.