Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Current version of code used to produce trace() results above in thread

by wardk (Deacon)
on Apr 15, 2002 at 15:17 UTC ( #159226=note: print w/ replies, xml ) Need Help??


in reply to Current version of code used to produce trace() results above in thread
in thread DBI SQL Syntax Problem

In the above SQL you (still) have commas in your WHERE clause. the SQL below should be valid, assuming that the values you are binding conform to the column data types. (Note that the last comma after e_time set is invalid preceeding the WHERE.)

One thing that works well for me when confronted by sql coding problems is to create the SQL standalone and execute it (for instance via SQLPlus (or mySQL equivalent)) until it's syntactically correct, then take that SQL and implement it. I suspect among other things, the '12:00 PM' has a problem with the space-PM, and time_end = '01:00 ' has issues with the trailing space (chomp?).

$sth = $dbh-> prepare("UPDATE $calendar_table SET year = ?, month = ?, day = ?, time_start = ?, time_end = ?, title = ?, location = ?, description = ?, category = ?, posted_by = ?, post_date = ?, b_time = ?, e_time = ? WHERE year = ? AND month = ? AND day = ? AND time_start = ? AND time_end = ? AND title = ? ");


Comment on Re: Current version of code used to produce trace() results above in thread
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (14)
As of 2014-07-28 15:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (201 votes), past polls