Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Using placeholders, getting unexpected SQL errors

by Ineffectual (Scribe)
on Mar 14, 2003 at 00:39 UTC ( [id://242911]=note: print w/replies, xml ) Need Help??


in reply to Using placeholders, getting unexpected SQL errors

I'd use bind_param just because it sometimes gives you better error messages on what's wrong...

$phone_insert->bind_param(1, $row->{'cust_id'}); $phone_insert->bind_param(2, $adtID); $phone_insert->bind_param(3, $phoneNumberTypes->{'Day'}); $phone_insert->bind_param(4, $row->{'cust_phac'}); $phone_insert->bind_param(5, $row->{'cust_phpx'}); $phone_insert->bind_param(6, $row->{'cust_phsx'}); $phone_insert->bind_param(1, $row->{'cust_phex'}); $phone_insert->execute or die "$dbh->errstr\n";
Where $dbh is your database handle.

It looks to me like everything is being inserted as a number, thus it doesn't put 's around the values and therefore it's balking at the space in the 2 89 value.

HTH
'Fect

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://242911]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-13 22:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found