Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 scrutinizing the Monastery: (8)
As of 2014-12-20 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls