MySQL Forums
Forum List  »  Connector/Python

Re: Storing a picture on db with python
Posted by: cory nardin
Date: August 28, 2007 01:45PM

I am very new to MySQL, and have never done this so I don't promise to be much of a guiding light, but can you post the sql statement that you are using and possibly the pertinent code segment?

One thing that I just thought about is that you said that you are importing the picture as a string. I had a similar problem with inserting a block of text into a TEXT field. Basically what my problem was is that my string had quotes in it, so when I inserted it into the sql statement it thought that the leading quote from my string was actually the closing quote to something else. Basically it thought that a large part of my text blob was part of the statement.

I don't know if I am making sense here, but perhaps your image string has a quotation mark in it that is screwing things up for you in the second case. I don't know what you can do to fix it though. What I did was change occurrences of " with an escaped quote \" which seemed to fix the problem.

Options: ReplyQuote


Subject
Written By
Posted
Re: Storing a picture on db with python
August 28, 2007 01:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.