【问题标题】:What does this ORM kohana3 query do?这个 ORM kohana3 查询有什么作用?
【发布时间】:2011-08-12 08:35:22
【问题描述】:

我无法解释来自Kohana 3 ORM 框架的这个 ORM 查询。请帮助我理解这一点:

$member_type_id=ORM::factory("member")->where('id',$videos[$count]->member_id)->find();

【问题讨论】:

  • 只是一个旁注:对于 Kohana3 ORM,这是行不通的。 where 方法需要 3 个参数:->where('id', '=', $videos[$count]->member_id)

标签: php orm kohana-3


【解决方案1】:
SELECT * FROM member WHERE id = <$videos[$count]->member_id>

查询最多返回一个结果。

【讨论】:

  • 当我写这个查询它给出以下错误信息: $sql = DB::query(Database::SELECT,"select * from member where 'id' = $videos[$count]-> member_id); ErrorException [ Recoverable Error ]: stdClass 类的对象无法转换为字符串
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-12-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多