Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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";?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043160]
[1nickt]: karlgoethebier Thank you!! How could I not have ever heard of this musician?
[choroba]: thezip should be ok.
[thezip]: It seemed so, choroba, but I don't want to confuse anyone (especially myself!)
[choroba]: thezip unless something like this happens to you.
[thezip]: I don't intend on doing any offline development in the Czech Republic soon, so i think I'm safe!
[thezip]: :-)
[choroba]: Yeah, there are countries with wifi everywhere
[choroba]: also, I didn't have a smart phone at that time

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-03-23 21:06 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (294 votes). Check out past polls.