White scenery @showyou, hatena

If you have any comments, you may also send twitter @shsub or @showyou.

pythonでMySQL

テスト

class TempDB:
	def connect(self):
		# MySQLデータベースに接続
		self.con = MySQLdb.connect(db="test",user="hoge",passwd="fuga")
		self.cur = con.cursor()
                str = "SELECT * FROM nantoka WHERE valuename = %d"
	#def execute(self,str,args):
		self.cur.execute(str,[1])
	
	#def close(self):
		#
		r = self.cur.fetchone()
		while r != None:
			print r
			r = self.cur.fetchone()
	
		# カーソルを閉じる
		self.cur.close()
		self.con.close()