changeset 1686:9e0e74616fa6

プログラムを改良
author houtin <c115080@g.koeki-u.ac.jp>
date Thu, 27 Jul 2017 07:12:37 +0900
parents 8bc8688623ad
children 3d909744c9f0
files event/oasis2017/quiz/kantan.rb
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/event/oasis2017/quiz/kantan.rb	Thu Jul 27 00:13:54 2017 +0900
+++ b/event/oasis2017/quiz/kantan.rb	Thu Jul 27 07:12:37 2017 +0900
@@ -74,9 +74,9 @@
   now = Time.now.strftime("%F %T")
   db.execute("REPLACE INTO users VALUES(?, ?, ?)", id, form_name, now);
 else				# 若namedb
-  dbname = db.execute("SELECT name from users WHERE id=?", id)[0][0]
-  if dbname != nil
-    playname = dbname		# 若帥若鴻ゅ
+  dbn = db.execute("SELECT name from users WHERE id=?", id)[0]
+  if dbn != nil &&  dbn[0]
+    playname = dbn[0]		# 若帥若鴻ゅ
   end
 end
 if playname == ""

yatex.org