<bdo id='H8DQQ'></bdo><ul id='H8DQQ'></ul>
    <legend id='H8DQQ'><style id='H8DQQ'><dir id='H8DQQ'><q id='H8DQQ'></q></dir></style></legend>
    1. <i id='H8DQQ'><tr id='H8DQQ'><dt id='H8DQQ'><q id='H8DQQ'><span id='H8DQQ'><b id='H8DQQ'><form id='H8DQQ'><ins id='H8DQQ'></ins><ul id='H8DQQ'></ul><sub id='H8DQQ'></sub></form><legend id='H8DQQ'></legend><bdo id='H8DQQ'><pre id='H8DQQ'><center id='H8DQQ'></center></pre></bdo></b><th id='H8DQQ'></th></span></q></dt></tr></i><div id='H8DQQ'><tfoot id='H8DQQ'></tfoot><dl id='H8DQQ'><fieldset id='H8DQQ'></fieldset></dl></div>
    2. <small id='H8DQQ'></small><noframes id='H8DQQ'>

      <tfoot id='H8DQQ'></tfoot>

        Python MySql 插入不起作用

        Python MySql Insert not working(Python MySql 插入不起作用)
        <i id='nx4Hp'><tr id='nx4Hp'><dt id='nx4Hp'><q id='nx4Hp'><span id='nx4Hp'><b id='nx4Hp'><form id='nx4Hp'><ins id='nx4Hp'></ins><ul id='nx4Hp'></ul><sub id='nx4Hp'></sub></form><legend id='nx4Hp'></legend><bdo id='nx4Hp'><pre id='nx4Hp'><center id='nx4Hp'></center></pre></bdo></b><th id='nx4Hp'></th></span></q></dt></tr></i><div id='nx4Hp'><tfoot id='nx4Hp'></tfoot><dl id='nx4Hp'><fieldset id='nx4Hp'></fieldset></dl></div>
        • <small id='nx4Hp'></small><noframes id='nx4Hp'>

            <bdo id='nx4Hp'></bdo><ul id='nx4Hp'></ul>
            <tfoot id='nx4Hp'></tfoot>

                <legend id='nx4Hp'><style id='nx4Hp'><dir id='nx4Hp'><q id='nx4Hp'></q></dir></style></legend>

                  <tbody id='nx4Hp'></tbody>

                  本文介绍了Python MySql 插入不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 python MySQL API 从 python 程序连接到 Mysql 数据库.我从几天就面临一个问题.我无法将记录插入数据库,不知道是什么原因.这是我连接并将记录插入数据库的方式.

                  I am using python MySQL API to connect to Mysql database from python program. I am facing a problem from few days. I am unable to insert records into the database and dont know whats the reason. Here is the way i connect and insert records into the database.

                  db = MySQLdb.connect("localhost","root","padmaramulu","pdfsearch" )
                  cursor = db.cursor()
                  #cursor.execute("""CREATE TABLE IF NOT EXISTS documents (docid INT NOT NULL ,PRIMARY KEY(docid),docname CHAR(30)) engine=innodb""")
                  temp = "hello";number = 2;
                  cursor.execute( 'insert into documents(docid,docname) values("%d","%s")' % (number,temp) )
                  db.close()
                  

                  为什么会这样?

                  推荐答案

                  在关闭连接之前,你应该添加db.commit().

                  Before closing the connection, you should add db.commit().

                  这篇关于Python MySql 插入不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)
                    1. <small id='TeIdS'></small><noframes id='TeIdS'>

                          <tbody id='TeIdS'></tbody>
                        <legend id='TeIdS'><style id='TeIdS'><dir id='TeIdS'><q id='TeIdS'></q></dir></style></legend>

                          • <bdo id='TeIdS'></bdo><ul id='TeIdS'></ul>

                            <tfoot id='TeIdS'></tfoot>
                          • <i id='TeIdS'><tr id='TeIdS'><dt id='TeIdS'><q id='TeIdS'><span id='TeIdS'><b id='TeIdS'><form id='TeIdS'><ins id='TeIdS'></ins><ul id='TeIdS'></ul><sub id='TeIdS'></sub></form><legend id='TeIdS'></legend><bdo id='TeIdS'><pre id='TeIdS'><center id='TeIdS'></center></pre></bdo></b><th id='TeIdS'></th></span></q></dt></tr></i><div id='TeIdS'><tfoot id='TeIdS'></tfoot><dl id='TeIdS'><fieldset id='TeIdS'></fieldset></dl></div>