jijianqiao
- jijianqiao 回答了问题 在某个字段中截取出ID的值
问题不详细,无法回答,只能揣测:
比如:内容和ID直接使用特殊的符号将其连接起来比如“-”或者“|”
$data->I_content = "我的内容是大法师地方-12";
$arr = explode("-", $data->I_content);
$id = $arr[1]; //$data->I_content中特殊符号"-"只能唯一,不能出现两个以上
- jijianqiao 回答了问题 验证码问题请教!
不需要呀,你可以参考 blog下面的 contact 下面的方法。
public function actions() { return array( // captcha action renders the CAPTCHA image displayed on the contact page 'captcha'=>array( 'class'=>'CCaptchaAction', 'minLength'=>4, 'maxLength'=>5, 'backColor'=>0xFFFFFF, ), // page action renders "static" pages stored under 'protected/views/site/pages' // They can be accessed via: index.php?r=site/page&view=FileName 'page'=>array( 'class'=>'CViewAction', ), ); }
将此代码附加在
protected/components/Controller.php
中 - jijianqiao 回答了问题 Yii查询怎么返回结果的条数
- 如果你写的SQL语句比较简单,建议使用下面的方法:
//得到行数目或者其他数目 count // get the number of rows satisfying the specified condition $n=Post::model()->count($condition,$params); // get the number of rows using the specified SQL statement $n=Post::model()->countBySql($sql,$params); // check if there is at least a row satisfying the specified condition $exists=Post::model()->exists($condition,$params);
- 如果你写的SQL语句比较复杂,建议使用下面的方法:
$sql = "SELECT ...... FROM .........LEFT JOIN offer o ON o.`offer_id`=......"; $total_sql = "SELECT COUNT(o.offer_id) num ".strstr($sql, 'FROM'); $this->connection->createCommand($total_sql)->queryScalar();
- jijianqiao 回复了话题 将YII进行到底!(视频)
谢谢楼主分享
- jijianqiao 回复了话题 YII写的网络公司CMS站(原创)
下来学习一下
- jijianqiao 回复了话题 Yii框架实例下载————快来看吧
谢谢,楼主分享,下来看看
谢谢,楼主分享,下来学习一下
谢谢楼主分享,我下载学习一下
下载下来学习一下