Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Rows fail to delete without error

by trs80 (Priest)
on Apr 08, 2002 at 21:34 UTC ( [id://157570]=note: print w/replies, xml ) Need Help??


in reply to Rows fail to delete without error

I looked back at some of your past posts before I made this post. I am not sure what your immediate problem is, but you have some serious scoping issues in your scripts. I am also not sure why you are so verbose with your execute statements. The delete could be rewritten as:
$sth = $dbh->prepare(qq!DELETE FROM $holding_table WHERE year=? AND month=? AND day=? AND time_start=? AND time_end=? AND title=?"); $sth->execute(@key);
If there is a reason to use bind_param vs. this syntax someone please enlighten me, this is the way I have been doing it and it works for me, but TIMTOWTDI What are you doing at the bottom with @success_message? You assign a single value to it, but then does it get magically used by success_message? I say magicly because that is dangerous. You want to pass as much information into a sub as new each time. I would rewrite this as:
sucess_message( h2({-align=>'center'},"Database(s) updated. Thanks!") +);
or at the very least:
my @success_message = h2({-align=>'center'},"Database(s) updated. Than +ks!"); sucess_message( @success_message );
Where is $sth getting scoped at?
What is your DBI connect string? (does it have RaiseError?)

Please don't misread my curiosity as critizism.
UPDATE: This was funny, Ovid and I were talking about the similarity of another post with his last meditation and now I have posted what sounds similar to Ovid's post on this node. Very odd day.

Replies are listed 'Best First'.
Re: Re: Rows fail to delete without error
by jerrygarciuh (Curate) on Apr 08, 2002 at 21:42 UTC
    Thx for the reply, as RMGir pointed out my split was in the if block and elsif wasn't getting it. Regarding your question re bind_param() I was having a problem with failing to match know rows with simply using placeholders and someone suggested bind_param() and it worked so now I am cargo-cult programming and doing waht has worked without asking if it was a mere coincidence in the first place. Re using the array whole, I don't use the first element.
    Thx for the reply!!
    jg
    _____________________________________________________
    Think a race on a horse on a ball with a fish! TG
      Now you got me curious again. How do you not use the first element? You use @blah = h2("TEXT"); and then call blah, how does that not use the first element?
      my @success = h2({},'TEST'); success(@success); sub success { print shift , "\n"; }
      There is only one element in the list that I can see in that syntax, what I am missing?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-20 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found