插入单条数据, 获取插入数据的id. $model->attributes['id']; new model 添加数据的时候, 需要注意, 如果是想要循环添加多条数据的情况, new model 的操作要写在循环体里, 不小心写在循环体外面, 那么最终插入数据库中的数据将是遍历的最后一条数据. 把new model 操作写在循环体内才能成功插入遍历的全部数据.
http://poj.org/problem?id=2828 Buy Tickets Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 10478 Accepted: 5079 Description Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a lo