随笔 - 347  文章 - 1 评论 - 44 阅读 - 201万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

02 2014 档案
Yii框架操作数据库的几种方式与mysql_escape_string
摘要:一、Yii操作数据库的几种选择1,PDO方式。$sql = "";//原生态sql语句xx::model()->dbConnection->createCommand($sql)->execute();2,Active Record方式(1)New$post=new Post;$post->title='sample post';$post->content='post body content';$post->save();(2)Criteria方式也可以使用 $condition 指定更复杂的查询条件。 阅读全文
posted @ 2014-02-24 17:17 FreeSpider 阅读(3572) 评论(0) 推荐(0) 编辑
php获取某年某月的天数
摘要:function days_in_month($month, $year) { // calculate number of days in a month return $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31); } 阅读全文
posted @ 2014-02-12 14:24 FreeSpider 阅读(2955) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示