changeset 735:9406e1028f2a

prof.rb test
author ARAKI Tsuyohito <c113007@e.koeki-u.ac.jp>
date Tue, 07 Jul 2015 23:59:58 +0900
parents b9af73f84f99
children 1b644833d5d2
files oasis2015/accountcheck.rb oasis2015/prof.rb
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/oasis2015/accountcheck.rb	Tue Jul 07 23:57:46 2015 +0900
+++ b/oasis2015/accountcheck.rb	Tue Jul 07 23:59:58 2015 +0900
@@ -19,6 +19,9 @@
 db.execute(cle3)
 db.execute(cle4)
 
+id = c.cookies["id"][0]
+person = id.to_i
+
 name = c["name"]
 cal = c["cal"]
 age = c["age"]
--- a/oasis2015/prof.rb	Tue Jul 07 23:57:46 2015 +0900
+++ b/oasis2015/prof.rb	Tue Jul 07 23:59:58 2015 +0900
@@ -9,7 +9,7 @@
 id = c.cookies["id"][0]
 person = id.to_i
 
-data = "select * from toi where id = ?"
+data = "select * from test where id = ?"
 #idが?(後で代入)のデータをtest票から探す。という命令をdataにしくむ。全てがほしい場合は「*」。「*」を「name」に変えると該当データのnameだけとりだす。
 cook = db.execute(data, person)               #dataに仕組んでいた命令を、personを代入しつつ実行。
 jikan1 = "select * from time where cd = ?"

yatex.org