作者ppoozine (阿翔)
看板Python
标题[问题] mysql资料抓入阵列里
时间Tue Oct 25 22:51:38 2016
请问一下
我在mysql资料中有一笔资料
分别为id,datetime
我想要将datetime放入阵列中
每次更新时都去比对id号码
如果资料不同就更新资料
http://i.imgur.com/1rwaAHX.jpg
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 182.155.28.23
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1477407101.A.B63.html
1F:推 aweimeow: 纯推很精致漂亮的图 ~~~ 10/25 23:49
2F:推 indigolemon: 怎麽感觉话没说完,不懂问题是什麽。 10/26 00:30
3F:推 IMPOSSIBLEr: 不懂问题是什麽+1 10/26 06:01
4F:→ s860134: 就照你写的做啊 有问题吗? 没有阿 10/26 08:19
5F:推 JUNYOU01: 你应该是想一直更新每个id的时间吧,直接用sql语法就好 10/26 12:54
6F:→ JUNYOU01: 了呀,你只把时间append在list里面,他也没办法去比对id 10/26 12:54
7F:→ JUNYOU01: 吧 10/26 12:54
8F:推 JUNYOU01: 除非你用dict的型态把id和时间都存进list里面,再比对 10/26 12:58
9F:推 hung0724: { id1: time1, id2: time2, id3: time3} 这样? 10/26 21:36
10F:→ CaptainTeemo: 用 OrderedDict 10/27 08:23