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 exploiting the Monastery: (13)
As of 2016-02-12 13:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (398 votes), past polls