<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>steffler's archive &#187; mysql</title>
	<atom:link href="http://steffler.info/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://steffler.info</link>
	<description>bits of code i wrote and stuff about things and such.</description>
	<lastBuildDate>Tue, 18 May 2010 00:50:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Simple Example Usage of MySQLdb with Python</title>
		<link>http://steffler.info/simple-example-usage-of-mysqldb-with-python/</link>
		<comments>http://steffler.info/simple-example-usage-of-mysqldb-with-python/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 03:39:28 +0000</pubDate>
		<dc:creator>steffler</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqldb]]></category>
		<category><![CDATA[py]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://steffler.info/?p=21</guid>
		<description><![CDATA[MySQLdb is a set of open source Python libraries that allow you to interact with MySQL databases at a higher level than the traditional C API methods.

Here is some code that takes two command line arguments, and stuffs them into a table as contents of the fields "ID" and "INPUT".  (in other words it is a simple database of ID numbers and text).]]></description>
			<content:encoded><![CDATA[<p><a href="http://sourceforge.net/projects/mysql-python">MySQLdb</a> is a set of open source <a href="http://www.python.org" target="_blank">Python</a> libraries that allow you to interact with <a href="http://www.mysql.com" target="_blank">MySQL</a> databases at a higher level than the traditional C API methods.</p>
<p>Here is some code that takes two command line arguments, and stuffs them into a table as contents of the fields &#8220;ID&#8221; and &#8220;INPUT&#8221;.  (in other words it is a simple database of ID numbers and text).</p>
<pre>#!/usr/bin/env python
#
# example of taking data from Python variables and inserting them into a database.
import MySQLdb, sys

id = sys.argv[1]
input = sys.argv[2] 

sql = "INSERT INTO your_table_name (id, input) VALUES("
sql += id
sql += ", '"
sql += input
sql += "')"

db = MySQLdb.connect(host="yourhost" db="yourdb", user="username", passwd="password" )
dbc = db.cursor()
dbc.execute(sql)</pre>
<p>It&#8217;s JUST THAT EASY! <img src='http://steffler.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://steffler.info/simple-example-usage-of-mysqldb-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

