小编Aam*_*mir的帖子

PHPMYADMIN 异常:指定的上下文(“\SqlParser\Contexts\ContextMySql50724”)不存在

我使用的是 Ubuntu 18.04,Zend Framework 3,并将 Xdebugger 与 Visual Studio 集成。现在,当我在 Visual Studio 中启动调试器并在浏览器中的本地主机上重新加载 phpmyadmin 网页时localhost/phpmyadmin,它会显示此错误

在此输入图像描述

尽管我没有设置任何断点,但每次它仍然停在上面屏幕截图所示的位置。

Xdebug.ini

xdebug.show_error_trace = 0
xdebug.show_exception_trace = 0
zend_extension=/usr/lib/php/20170718/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
xdebug.remote_connect_back=1
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏。

php zend-framework xdebug phpmyadmin visual-studio-code

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

使用Eloquent的Laravel Chunk方法

对于处理大型数据库,laravel提供了块方法,如https://laravel.com/docs/5.1/queries#retrieving-results

但是如何在此查询中使用chunk方法,

 $data = Inspector::latest('id')
                ->select('id', 'firstname', 'status', 'state', 'phone')
                ->where('firstname', 'LIKE', '%' . $searchtext . '%')
                ->get();
Run Code Online (Sandbox Code Playgroud)

我正在返回这样的json响应,

echo json_encode($data);
Run Code Online (Sandbox Code Playgroud)

有什么建议....

php json laravel eloquent laravel-5

4
推荐指数
3
解决办法
2万
查看次数

Cassandra INSERT查询错误

我在Cassandra中的插入查询出错了"错误:第5:75行不匹配输入'-02'期待'''(log_sid)"

我的查询是:

   INSERT INTO table_name(account_sid, datetime_uuid, log_add_name, log_detail, log_post_back, log_post_front, log_price, log_request_type, log_sid) VALUES ('YTe9e7d2f82f2d88db31cfcafd9f4a7a2d', 2016-02-12 11:45:37, 'Birthday gft','{"Postcard_message":"","Postcard_size":"1001","Postcard_data":""}', 'pdf file google storage path1', 'pdf file google storage path2', 0.8750,'postcard', 'psc_5823b1cb9445335d');
Run Code Online (Sandbox Code Playgroud)

php database cql cassandra cassandra-2.0

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

Select2 TypeError:b未定义

在此输入图像描述在此输入图像描述我正在使用select2在下拉列表中显示ajax结果但是当我将数据追加到select2时它显示错误

TypeError: b is undefined
Run Code Online (Sandbox Code Playgroud)

JS代码

        var baseurl = $("#baseurl").val();
        $(".myselect").select2({
            placeholder: "Select a inspector",
            allowClear: true,
            ajax: {
                url: baseurl + '/admin/getdata',
                dataType: 'json',
                type: "GET",
                quietMillis: 50,
                data: function (term) {
                    return {
                        term: term.term
                    };
                },
                results: function (data) {
                    var myResults = [];
                    $.each(data, function (index, item) {
                        myResults.push({
                            'id': item.id,
                            'text': item.firstname
                        });
                    });
                    return {
                        results: myResults
                    };
                }
            }
        });
Run Code Online (Sandbox Code Playgroud)

term.term包含下拉搜索框中输入文本的值.

HTML

  <select class="myselect" style="width: 50% !important">
        <option></option>
        <option value="AL">Alabama</option>
        <option value="WY">Wyoming</option>
        <option …
Run Code Online (Sandbox Code Playgroud)

javascript php jquery laravel select2

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

获取图像尺寸(高度和宽度)Js或jquery

我已经搜索过这个,但是每次我实现代码时,当我上传400X400图像时,它都会返回 24 作为高度和宽度作为 237。

$(document).on('change','#tt' , function(){
    var img = document.getElementById('tt');
    var nheight = img.clientHeight;
    var nwidth = img.clientWidth;
    alert(nheight)
    alert(nwidth)
});
Run Code Online (Sandbox Code Playgroud)
$(document).on('change','#tt' , function(){
    var img = document.getElementById('tt');
    var nheight = img.clientHeight;
    var nwidth = img.clientWidth;
    alert(nheight)
    alert(nwidth)
});
Run Code Online (Sandbox Code Playgroud)

有谁知道当我上传图像时如何在警报框中获得 400 的高度和 400 的宽度400X400。非常感谢任何帮助......

html javascript jquery image

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

Symfony 重定向(如果已从登录页面登录)

我正在使用 FOSUser Bundle 登录。现在,如果用户已经登录,如果用户访问 /login url,我如何将用户重定向到主页('/')。

我已将 SecurityController 复制到 src\AppBundle\Controller 位置并更改了 renderlogin 方法,但它不起作用。

renderLogin() 方法

protected function renderLogin(array $data)
{
    if (false === $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_ANONYMOUSLY')) {
        return new RedirectResponse('/', 403);
    }
    return $this->render('@FOSUser/Security/login.html.twig', $data);
}
Run Code Online (Sandbox Code Playgroud)

我也在安全控制器中添加了这一行,

use Symfony\Component\HttpFoundation\RedirectResponse;
Run Code Online (Sandbox Code Playgroud)

任何帮助深表感谢。

php redirect symfony symfony-2.8

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

如何使用php的password_hash()方法..?

我登录时收到密码不匹配,当用户注册时,我将密码保存为

$password = password_hash($this->input->post('password'), PASSWORD_BCRYPT);
Run Code Online (Sandbox Code Playgroud)

当用户登录我正在检查这样的密码时,

    $hash = password_hash($password, PASSWORD_BCRYPT);
    $this->db->select('password');
    $this->db->from('usersdetails');
    $this->db->where('email', $email);
    $this->db->limit(1);
    $query = $this->db->get();
    $passwordcheck = $query->row()->password;
    if (password_verify($passwordcheck, $hash)) {
       return true;
    } else {
        return false;
    }
Run Code Online (Sandbox Code Playgroud)

但它总是返回密码不匹配..为什么????? 任何帮助深表感谢...

php mysql passwords login codeigniter

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