<br><br><div class="gmail_quote">On Sun, Oct 11, 2009 at 5:06 PM, aditya shukla <span dir="ltr"><<a href="mailto:adityashukla1983@gmail.com">adityashukla1983@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello Stephen,<br></blockquote><div>    <br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>I have put the code and the traceback.Can you please help me now? .I am scratching my head :)<br>
<br>I am using python 2.6 on windows 7 and MySQLdb to make connections to
the database.The issue here is that I  am not able to insert from the
python script to the database.When I run the same query in mysql query
brower then the insert statement works .I am able to select from the
database  using the python script.The connection is fine.I am using
Aptana to write the python script.<br>
<br></div><div class="im">I thought this could be a problem of the collation or character set
problem  the default character set  of the system is cp1252 which
corrosponds to latin_1 on mysql , I have chosen that and still no help.
Any help is appreciated.<br><br></div>this what the code looks like.<br><br><br>db = MySQLdb.connect("localhost","root","juventus12","factoids",charset = "utf8", use_unicode = True )<br>

cursor= db.cursor()   # i added charset = "utf8", use_unicode = True just now and changed the character set of mysql still no help.<br><br>cursor.execute("""INSERT INTO question_table (question_id,source_id,question) VALUES (5,1,"question")""")<br>

<br><br>language, output_encoding = locale.getdefaultlocale()<br><br>print output_encoding, language<br><br><br>traceback<br><br>C:\Python26\lib\site-packages\MySQLdb\__init__.py:34: DeprecationWarning: the sets module is deprecated<br>

  from sets import ImmutableSet<br><br>cp1252 en_US<br><br>Thanks<br><font color="#888888"><br>Aditya<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</font></blockquote></div><br>