Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: DBD::mysql trouble

by zwon (Abbot)
on Sep 22, 2009 at 18:28 UTC ( [id://796792]=note: print w/replies, xml ) Need Help??


in reply to DBD::mysql trouble

The error is because values aren't quoted. Rewrite your queries as follows:

$dbh->do("INSERT INTO Repairs.customers (firstname, lastname, email, p +hone, date) VALUES (?,?,?,?,?)", {}, $customer_firstname, $customer_l +astname, $customer_email, $customer_phone, $customer_date);

Replies are listed 'Best First'.
Re^2: DBD::mysql trouble
by vendion (Scribe) on Sep 23, 2009 at 16:33 UTC

    Ok after doing that meathod the error I get now is:

    DBD::mysql::db do failed: Column count doesn't match value count at row 1 at repairs.pl line 112, <STDIN> line 14
    As for the suggestions about using arrays I was thinking about changing to that or a hash once I got the mysql part to work, yes I agree it would be easier and look cleaner but that is the last thing I have to worry about here

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-26 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found