「php+SQLDBで連続無事故日数カウントWebを作ってみた」
Web_URL
http://dasudasu.sakura.ne.jp/tbl_20170621/20170621_list.php
http://dasudasu.sakura.ne.jp/tbl_20170621/20170621_list.php
20170621_form.html
20170621_list.php
20170621_trDB.php
20170621_view.php
20170621_updateform.php
20170621_list.php
20170621_trDB.php
20170621_view.php
20170621_updateform.php
DB名:dasudasu_tbl
テーブル名:tbl_t
項目
tr_Num id
tr_date hakkaku_date
tr_today
tr_service service_name
tr_contents naiyou
d_bit
テーブル名:tbl_t
項目
tr_Num id
tr_date hakkaku_date
tr_today
tr_service service_name
tr_contents naiyou
d_bit
INSERT INTO tbl_t (tr_date, tr_service, tr_contents) VALUES ( now(), ‘service_name’, ‘naiyou’ )
で今日の日付が入る!!!OK
で今日の日付が入る!!!OK
select max(tr_date) from tbl_t
select min(tr_date) from tbl_t
もOK
select min(tr_date) from tbl_t
もOK
select * from tbl_t WHERE tr_date = (select max(tr_date) from tbl_t)
もOK
もOK
UPDATE tbl_t SET tr_today = (now()) WHERE tr_date = “2017-06-10”
もOK
もOK
SELECT DATEDIFF(now(), (select max(tr_date) from tbl_t)) FROM tbl_t;
もOK
もOK
<ゴミ>
UPDATE tbl_t SET tr_today = (now()) WHERE tr_date = (select max(tr_date) from tbl_t);
insert into tbl_t (tr_today) values (now()) WHERE tr_date = (select max(tr_date) from tbl_t)
UPDATE tbl_t SET tr_today = value( now()) WHERE tr_date = “2017-06-10”
UPDATE tbl_t SET tr_today = now() WHERE tr_date = (select max(tr_date) from tbl_t);
UPDATE tbl_t SET tr_today = value( now()) WHERE tr_date = (select max(tr_date) from tbl_t)
SELECT date1, date2, DATEDIFF(day, date1, date2) FROM tbTestTable;
SELECT DATEDIFF(now(), (select max(tr_date) from tbl_t)) FROM tbl_t;
UPDATE tbl_t SET tr_today = (now()) WHERE tr_date = (select max(tr_date) from tbl_t);
insert into tbl_t (tr_today) values (now()) WHERE tr_date = (select max(tr_date) from tbl_t)
UPDATE tbl_t SET tr_today = value( now()) WHERE tr_date = “2017-06-10”
UPDATE tbl_t SET tr_today = now() WHERE tr_date = (select max(tr_date) from tbl_t);
UPDATE tbl_t SET tr_today = value( now()) WHERE tr_date = (select max(tr_date) from tbl_t)
SELECT date1, date2, DATEDIFF(day, date1, date2) FROM tbTestTable;
SELECT DATEDIFF(now(), (select max(tr_date) from tbl_t)) FROM tbl_t;
まだ途中!!!!!