Check out Symmetric Chess, our featured variant for March, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Home page of The Chess Variant Pages. Homepage of The Chess Variant Pages.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Sat, Feb 4, 2023 02:07 AM UTC in reply to A. M. DeWitt from 12:34 AM:

I successfully tried updating a couple of my comments, including one on this page, and I successfully updated the comment you referred to, though that was with a different script than you would use. So, I have not been able to repeat what you did.

Looking at the PHP error log, I see multiple errors looking like this:

Failed to prepare SQL in update_row: UPDATE `Comment` SE WHERE `CommentID` = :keyvalue

This was added to the error log by a catch clause I have in update_row().

That "SE" shouldn't be there, but there should be the word "SET" followed by a series of parameters being assigned to table columns. Since we appear to be in the same time zone, these were just over an hour and a half ago, and I was not doing any programming then.

Looking at the individual lines modifying $sql, most lines just append to it, and one uses substr to delete the last two characters. That points to one thing that happened. The $sql string could have this value if it were passed an empty array. After appending nothing to "UPDATE Comment SET ", it chopped off the last two characters and appended " WHERE CommentID = :keyvalue". I added some code to update_row to catch this error before this happens, but I'm still not sure why it happened. This is about what arguments were passed in the function call and not about how the function operated.