Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 pondering the Monastery: (5)
As of 2014-07-12 15:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls