小编Mic*_*ina的帖子

如何在mysql中获得没有大于40个字符的单词的列?

基本上,我正在尝试在php中创建一个函数,它将为我提供最新的列(消息),其中没有超过40个字符的单词.我能够获得最新的消息,但我不知道如何只获取没有大于40个字符的单词的最新消息.请参考$ callrecent变量.

<?php
function recentpost($postnum) {
$callrecent = "SELECT message FROM messages WHERE message (HAS NO WORD GREATER THAN 40 CHARACTERS) ORDER BY msg_id DESC LIMIT $postnum,1";

$callrecent_run = mysql_fetch_assoc(mysql_query($callrecent));

$message = stripslashes($callrecent_run['message']);

return $message;
}
?>
Run Code Online (Sandbox Code Playgroud)

php mysql character cpu-word

3
推荐指数
1
解决办法
144
查看次数

如何将旧的OOP PHP项目转换为Yii框架?

我已经有一个工作的OOP网站.大部分的php都是从html中分离出来的.我想知道是否有人有关于如何将该网站应用到Yii框架的任何提示.

编辑

该网站使用jquery,html,css,php,javascript.它还包含我购买代码峡谷的很多库和类.像地理定位库,phpthumb(图像缩略图),喜欢和不喜欢系统.如何将这些库导入Yii?

php oop yii web

3
推荐指数
1
解决办法
1824
查看次数

当CodeIgniter中有额外的URL段时,如何显示404?

基本上,我有一个CodeIgniter站点,通过此URL注册用户:http:
//website.com/user/register/1

不幸的是,当您在URL中传递额外的参数时,请执行以下操作:http: //website.com/user/register/1/extraargs/extraargs

这是我的代码:

<?php
class User extends CI_Controller
{
    public function register($step = NULL)
    {
        if (($step!=NULL)&&($step == 1 || $step == 2 || $step == 3)) {
            if ($step == 1){
                $this->load->view('registration_step1');
            }
        } else {
            show_404();
        }
    }
}
?>
Run Code Online (Sandbox Code Playgroud)

它没有显示404.它只是忽略了额外的参数.我想要它,以便额外的参数不会影响URL.如果有额外的URL参数,我想显示404.你怎么做到这一点?此外,额外的URL细分可以影响安全性吗?谢谢.

php url arguments codeigniter segments

2
推荐指数
1
解决办法
166
查看次数

标签 统计

php ×3

arguments ×1

character ×1

codeigniter ×1

cpu-word ×1

mysql ×1

oop ×1

segments ×1

url ×1

web ×1

yii ×1