Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
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 ( [id://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 = ? ");

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-03-29 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found