in reply to Updating a new column entry for CGI::Session 'sessions' table

I could be off base - I know nothing about CGI:SESSION, and I haven't seen enough of your code... What if you replaced the literals in your update statements with placeholders and then pass through your values later to a prepared statement? I've often seen problems with interpolation of scalars in SQL statements, which is why I tend to prefer placeholders.

  • Comment on Re: Updating a new column entry for CGI::Session 'sessions' table

Replies are listed 'Best First'.
Re: Re: Updating a new column entry for CGI::Session 'sessions' table
by soon_j (Scribe) on Mar 25, 2004 at 16:00 UTC
    I could try that suggestion. However, all my previous implementations were using interpolations and I had no problem. It just appeared that it's locking the session entry so that it can't be modified by an external process. I just have no idea if it's really such.Could MySQL lock a single row entry rather that the entire table?
      Are you testing for errors after your execute, or is RaiseError set for your database handle? Sorry, I don't know much about MySQL. If it was a locking problem, I'd either expect your SQL to hang until the lock was released, or return immediately because your update couldn't get a lock...