上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: 'Post' , 'tags' = > 'Tag' , ) ; public function testFindPost( ) { //调用 find 时,我们使用 $condition 和 $params 指定查询条件。 //此处 $condition 可以是 SQL 语句中的 WHERE 字符串,$params 则是一个参数数组, //其中的值应绑定到 $condation 中的占位符。 $ post = $ th... 阅读全文
posted @ 2014-04-12 18:54 Otgs 阅读(343) 评论(0) 推荐(0) 编辑
摘要: CDbConnection: 一个抽象数据库连接CDbCommand: SQL statementCDbDataReader: 匹配结果集的一行记录CDbTransaction:数据库事务访问数据库前需要建立数据库连接;使用DAO建立一个抽象数据库链接:$connection = new CDbConnection($dsn, $username, $password);$connection->active = true; // 只有激活了连接才可以使用$connection->active = false; // 关闭连接CDbConnection继承自CApplication 阅读全文
posted @ 2014-04-12 17:38 Otgs 阅读(196) 评论(0) 推荐(0) 编辑
摘要: public function getMinLimit () { $sql = "..."; $result = yii::app()->db->createCommand($sql); $query = $result->queryAll(); return array ( $query [0] ['max'], ); }$connection=Yii::app()->db; $sql="SELECT u.account,i.* FROM sys_user as u left join user_info as i on 阅读全文
posted @ 2014-04-12 16:17 Otgs 阅读(1474) 评论(0) 推荐(0) 编辑
摘要: $str=preg_replace("/\s+/", " ", $str); //过滤多余回车$str=preg_replace("//si","",$str); //注释$str=preg_replace("//si","",$str); //过滤DOCTYPE$str=preg_replace("//si","",$str); //过滤html标签$str=preg_replace("//si","&q 阅读全文
posted @ 2014-04-10 09:52 Otgs 阅读(255) 评论(0) 推荐(0) 编辑
摘要: vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0"BOOTPROTO="none"HWADDR="00:0C:29:07:4F:E7"NM_CONTROLLED="yes"ONBOOT="yes"TYPE="Ethernet"UUID="7bae79f6-2020-41a6-a498-018779b9db12"IPADDR=192.168.0.71NETMASK=255.255.255.0N 阅读全文
posted @ 2014-03-28 17:53 Otgs 阅读(154) 评论(0) 推荐(0) 编辑
摘要: /如是COOKIE 里面不为空,则往里面增加一个商品IDif (!empty($_COOKIE['SHOP']['history'])){//取得COOKIE里面的值,并用逗号把它切割成一个数组$history = explode(',', $_COOKIE['SHOP']['history']);//在这个数组的开头插入当前正在浏览的商品IDarray_unshift($history, $id);//去除数组里重复的值$history = array_unique($history);// $arr = arr 阅读全文
posted @ 2014-03-25 18:57 Otgs 阅读(610) 评论(0) 推荐(0) 编辑
摘要: 1、可以在config.php中进行设置,默认为关闭状态。 'APP_DEBUG' => true打开\ThinkPHP\Common\debug.php文件可以查看debug的默认设置如下:return array('LOG_RECORD'=>true, //进行日志记录'LOG_RECORD_LEVEL'=>array('EMERG','ALERT','CRIT','ERR','WARN','NOTIC','INFO 阅读全文
posted @ 2014-03-25 09:44 Otgs 阅读(2624) 评论(0) 推荐(1) 编辑
摘要: 1、最新代码 "./", 'file_name_prefix' => 'cache', 'mode' => '1', //mode 1 为serialize model 2为保存为可执行文件 ); /** * 得到本类实例 * * @return Ambiguous */ public static function getInstance() { if(self::$_instance === null) { sel... 阅读全文
posted @ 2014-03-21 16:34 Otgs 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 1.申请成为服务号2.申请自定义菜单,得到appid和appsecert3.用appid和appsecert获得access token4.将菜单组织成结构,通过post提交给接口5.在消息接口中处理event事件,其中的click代表菜单点击,通过响应菜单结构中的key值回应消息static function createMean($access_token){ $url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=".$access_token; $data = '{ "b 阅读全文
posted @ 2014-03-21 12:42 Otgs 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 1 $grantType, 22 'scope' => $scopeUrl, 23 'client_id' => $clientID, 24 'client_secret' => $clientSecret 25 ); 26 //Create an Http Query.// 27 $paramArr = http_build_query($paramArr); 28 ... 阅读全文
posted @ 2014-03-21 10:27 Otgs 阅读(209) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 10 下一页