小编Sha*_*ara的帖子

PHP unserialize():偏移时出错

我有Drupal 6.20的问题.

可能在PHP更新后,站点停止工作.我明白了:

Notice: unserialize() [function.unserialize]: Error at offset 0 of 22765 bytes in /PATH/includes/cache.inc on line 33
Run Code Online (Sandbox Code Playgroud)

这是一行:

$cache->data = unserialize($cache->data);
Run Code Online (Sandbox Code Playgroud)

我将不胜感激任何帮助.

php serialization drupal drupal-6

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

如何传递函数以使用Blaze捕获Meteor中自定义组件中的事件

我想知道如何绑定/设置模板传递参数值以点击Meteor中模板中项目的事件.

我正在使用Meteor 0.7.0.1和Blaze UI包.我的主要想法是使用Blaze模板引擎在Meteor中构建可重用的自定义组件.我有以下组件,目前工作正常但我希望这可以更自定义并删除一些依赖项.这是我的组件模板postLinks

<template name="postLinks">
    <div id="link-popover-wrapper" >
        <ul class="link-popover">
        {{#each linkOptions}}
            <li><a tabindex="-1" class="link-action" id="link-{{value}}" href="#">{{label}}</a>
            </li>
         {{/each}}
        </ul>
    </div>
</template>
Run Code Online (Sandbox Code Playgroud)

postLinks组件用于myPostItem帮助程序.

Template.myPostItem.events({

    'click .post-item-link-picker': function (evt, tmpl) {
        var tmpPostId = this._id;
        var tempData = {linkOptions:[{label:'Favorite', value : 'favorite'},{label:'Wish list', value : 'wishlist'},{label:'Later', value : 'later'}, {label:"Read", value:"read"}]};

        var linkContent = Template.postLinks(tempData);
        $(".item-link-picker").popover({
            content: linkContent, html: true, placement: 'bottom', trigger: "manual",
            template: "UI_POPOVER_TEMPLATE"});
            $("#item-link-picker-"+tmpPostId).popover('show');
    },

    'click .link-action': function (evt, tmpl) {
        //.... …
Run Code Online (Sandbox Code Playgroud)

meteor meteor-blaze

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

使用变量从mysql获取数据

我正在使用此代码

<?php
  $word = $_POST['word'];
  $wid= $_POST['id'];
  print "<table>";
  print "<tr>";
  $sql= 'SELECT url_imgsrch FROM p_url_imgsrch where 'word_id'='[$wid]' ORDER BY RAND() LIMIT 5';
  $result   =   mysql_query($sql);
  while($row = mysql_fetch_array($result)){

           print ' <td>
               <img name="myimage" src="'.$row[0].'" width="100" height="100" alt="word" border="1"/>
            </td>';
  }
  print "</tr>";
  print "</table>";
  ?>
Run Code Online (Sandbox Code Playgroud)

我正在做的是使用where子句从mysql获取一个字段,但它显示错误

解析错误:语法错误,第21行的D:\ wamp\www\demo\login\card.php中的意外T_STRING

和第21行成立

$sql= 'SELECT url_imgsrch FROM p_url_imgsrch where 'word_id'='[$wid]' ORDER BY RAND() LIMIT 5';
Run Code Online (Sandbox Code Playgroud)

请指导我,我在做什么大错?请给我指导.

我认为我应该说清楚的一件事是"ord_id field"是Numeric(int)

php mysql sql variables post

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

yii model-> save not working for update value

public function actionUpdateprofile(){
    $user = User::model()->findByPk($_POST['User']['user_id']);
    $profile = Profile::model()->findByPk($_POST['User']['user_id']);

    if(isset($_POST['User']) || isset($_POST['Profile'])){
        $user->attributes = $_POST['User'];
        $profile->attributes = $_POST['Profile'];
        $user->save();
        $profile->save();

    }
}
Run Code Online (Sandbox Code Playgroud)

我做了这个代码来更新配置文件和用户表中的值.但它不起作用.如果我发送$_POST['Profile']['email'] = 'abc@gmail.com'; 没有错误但数据库仍显示旧值.为什么?

我在那里做错了什么?

这是结果$profile->attributes.电子邮件仍然具有旧价值.

Array
(
    [user_id] => 35
    [lastname] => asd
    [firstname] => asrtyr
    [email] => xyz.gmail.com
    [phoneno] => 123456
    [prof_img] => 
    [phoneno2] => 0
    [agentKey] => 
    [fb_id] => 
)
Run Code Online (Sandbox Code Playgroud)

php mysql yii

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

标签 统计

php ×3

mysql ×2

drupal ×1

drupal-6 ×1

meteor ×1

meteor-blaze ×1

post ×1

serialization ×1

sql ×1

variables ×1

yii ×1