Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Testing to INSERT or UPDATE MySQL record

by periapt (Hermit)
on Jan 18, 2005 at 21:03 UTC ( #423181=note: print w/ replies, xml ) Need Help??


in reply to Testing to INSERT or UPDATE MySQL record

You could also try a $sql = qq|SELECT COUNT(*) FROM bankend|; before the update/insert decision block. The program could then take the appropriate action depending on whether the result was 0, 1, or 2+ using a simple if-elsif-else ladder (for error checking).


PJ
use strict; use warnings; use diagnostics;


Comment on Re: Testing to INSERT or UPDATE MySQL record
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2015-07-02 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls