dpnv33177 2013-07-02 17:35
浏览 30
已采纳

使用php函数中的MongoCursor :: doQuery解析错误?

When i try to execute this one function, it returns an error saying "Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM on line 103".

In line 103, it looks like (This is the beginning part of the code)

  function get_list($option) 


{

    //$db = new db();

    //$db->getConnection();

    $rs = $this->db->MongoCursor::doQuery($this->sql, $this->sql_params);   //this is the line 103

    $this->resultList = $rs;

What am I doing wrong?

  • 写回答

1条回答 默认 最新

  • dpdkqls6399 2013-07-02 17:45
    关注

    You can not mix static and instance syntax. It would either be:

    $rs = $this->db->MongoCursor->doQuery($this->sql, $this->sql_params);

    or

    $rs = MongoCursor::doQuery($this->sql, $this->sql_params);

    I don't know what framework if any that you are using to tell you exactly what it should be but what I showed you will fix the syntax error.

    $this->db looks like it might be Codeigniter? But MongoCursor::doQuery() is vanilla PHP: http://php.net/manual/en/mongocursor.doquery.php

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿