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

Re: Mystified by why my UPDATE statement is not reflected in my database display

by OfficeLinebacker (Chaplain)
on Jul 08, 2013 at 18:55 UTC ( #1043160=note: print w/ replies, xml ) Need Help??


in reply to Mystified by why my UPDATE statement is not reflected in my database display

I found the error. Thanks to the suggestion to use the trace feature. I configured it to print the trace at level 4 to a file which I examined. The problem was I used the wrong column names for name and link.

"UPDATE $res_tbl SET name=?, link=?, availability=? WHERE id=?";

should have been

"UPDATE $res_tbl SET resource_name=?, resource_link=?, availability=? WHERE id=?";

However, I'm trying to understand why

$sth->execute($updated_name,$updated_link,$updated_avail,$id_to_update) || warn "Execute update failed: $dbh->errstr";

did not print an error to the browser; I guess because it returned a 1, even though it failed? I guess it should have been

$sth->execute($updated_name,$updated_link,$updated_avail,$id_to_update) && warn "Execute update failed: $dbh->errstr";?


Comment on Re: Mystified by why my UPDATE statement is not reflected in my database display
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2014-12-19 04:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (70 votes), past polls