<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.twig.es/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=Python_delete_from_mysql</id>
		<title>Python delete from mysql - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=Python_delete_from_mysql"/>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Python_delete_from_mysql&amp;action=history"/>
		<updated>2026-05-06T17:29:38Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.0</generator>

	<entry>
		<id>https://wiki.twig.es/index.php?title=Python_delete_from_mysql&amp;diff=2963&amp;oldid=prev</id>
		<title>George2: Created page with &quot;&lt;source lang=&quot;python&quot;&gt; #!/usr/bin/python  import MySQLdb  # Open database connection db = MySQLdb.connect(&quot;localhost&quot;,&quot;testuser&quot;,&quot;test123&quot;,&quot;TESTDB&quot; )  # prepare a cursor objec...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Python_delete_from_mysql&amp;diff=2963&amp;oldid=prev"/>
				<updated>2016-02-25T12:08:26Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt; #!/usr/bin/python  import MySQLdb  # Open database connection db = MySQLdb.connect(&amp;quot;localhost&amp;quot;,&amp;quot;testuser&amp;quot;,&amp;quot;test123&amp;quot;,&amp;quot;TESTDB&amp;quot; )  # prepare a cursor objec...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import MySQLdb&lt;br /&gt;
&lt;br /&gt;
# Open database connection&lt;br /&gt;
db = MySQLdb.connect(&amp;quot;localhost&amp;quot;,&amp;quot;testuser&amp;quot;,&amp;quot;test123&amp;quot;,&amp;quot;TESTDB&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
# prepare a cursor object using cursor() method&lt;br /&gt;
cursor = db.cursor()&lt;br /&gt;
&lt;br /&gt;
# Prepare SQL query to DELETE required records&lt;br /&gt;
sql = &amp;quot;DELETE FROM EMPLOYEE WHERE AGE &amp;gt; '%d'&amp;quot; % (20)&lt;br /&gt;
try:&lt;br /&gt;
   # Execute the SQL command&lt;br /&gt;
   cursor.execute(sql)&lt;br /&gt;
   # Commit your changes in the database&lt;br /&gt;
   db.commit()&lt;br /&gt;
except:&lt;br /&gt;
   # Rollback in case there is any error&lt;br /&gt;
   db.rollback()&lt;br /&gt;
&lt;br /&gt;
# disconnect from server&lt;br /&gt;
db.close()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>George2</name></author>	</entry>

	</feed>