teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

コード修正(Indent間違い)

2021/04/26 08:33

投稿

yujin1202
yujin1202

スコア61

title CHANGED
File without changes
body CHANGED
@@ -74,15 +74,15 @@
74
74
  for name in names:
75
75
  print(name)
76
76
 
77
- sql = "select Country, Agency, email from tb3 where Country='name'";
77
+ <tab> sql = "select Country, Agency, email from tb3 where Country='name'";
78
- cursor = connection.cursor()
78
+ <tab> cursor = connection.cursor()
79
- cursor.execute(sql)
79
+ <tab> cursor.execute(sql)
80
- listx1s = cursor.fetchall()
80
+ <tab> listx1s = cursor.fetchall()
81
81
 
82
- cursor.close()
82
+ <tab> cursor.close()
83
- connection.close()
83
+ <tab> connection.close()
84
84
 
85
- return render_template( 'index2.html', listx1s = listx1s)
85
+ <tab> return render_template( 'index2.html', listx1s = listx1s)
86
86
 
87
87
  if __name__ == '__main__':
88
88
  app.run()

2

コードの抜けを修正

2021/04/26 08:33

投稿

yujin1202
yujin1202

スコア61

title CHANGED
File without changes
body CHANGED
@@ -82,7 +82,7 @@
82
82
  cursor.close()
83
83
  connection.close()
84
84
 
85
- return render_template( 'indexs.html', listx1s = listx1s)
85
+ return render_template( 'index2.html', listx1s = listx1s)
86
86
 
87
87
  if __name__ == '__main__':
88
88
  app.run()

1

誤字修正

2021/04/25 14:20

投稿

yujin1202
yujin1202

スコア61

title CHANGED
@@ -1,1 +1,1 @@
1
- 【python+mysql】Select文のwhere句に、動的に変化する単語を挿入する書き方を教えてください。
1
+ 【python+mysql】select文のwhere句に、動的に変化する単語を挿入する書き方を教えてください。
body CHANGED
@@ -27,7 +27,7 @@
27
27
  >Australia
28
28
  >France
29
29
 
30
- 4)国名(この場合は、上記3か国)をSelect文のWhere句に代入して、変数として、情報を取りたいと考え、下記(a)の様にSelect文を書いたのですが、これが動作しません。
30
+ 4)国名(この場合は、上記3か国)をSelect文のwhere句に代入して、変数として、情報を取りたいと考え、下記(a)の様にSelect文を書いたのですが、これが動作しません。
31
31
  (a) sql = "select Country, Agency, email from tb3 where Country='name'";
32
32
  (このsql文をPythonに書くと、エラーは出ないのですが、出力が真っ白な画面となります。)
33
33