in reply to DBI returns zero!

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