ページへ戻る
− Links
印刷
Python/MySQLから使う基礎
の編集 ::
NJF Wiki
xpwiki
:
Python
/
MySQLから使う基礎
の編集
# l53f6cef の編集
ページ内容:
*データを取得する [#l53f6cef] データを取得するときには以下のようにします。 import MySQLdb connector = MySQLdb.connect(host="localhost",db = "python_test", user="myuser", passwd="mypassword", charset="utf8") cursor = connector.cursor() cursor.execute("SELECT * FROM test;") datas = cursor.fetchall() for row in datas: print row[0],row[1] cursor.close() connector.close() こちらは特に難しいところはないと思います。
編集の要約:
Q & A 認証:
ページ更新時は次の質問にお答えください。(プレビュー時は必要ありません)
Q:
「京都」の読みがな?(ひらがなで)
A:
お名前:
タイムスタンプを変更しない
テキスト整形のルールを表示する
[1]
Links list
(This host) = https://njf.jp
(This host)
/cms/modules/xpwiki/?cmd=edit&help=true&page=Python%2FMySQL%E3%81%8B%E3%82%89%E4%BD%BF%E3%81%86%E5%9F%BA%E7%A4%8E