douleijiang8111 2014-05-20 08:13
浏览 17
已采纳

在doophp中编写自定义查询

I am new to Doophp framework. I would like to write the following SQL query to be executed in Doophp. but I can't find any proper tutorials or reference regarding to this. Query is as follow;

SELECT * FROM m_company WHERE comp_id LIKE %$search% OR comp_kana LIKE %$search% OR comp_person LIKE %$search%

  • 写回答

1条回答 默认 最新

  • douganbi7686 2014-07-16 00:19
    关注

    in Doo db SmartModel you can use the "custom" paramters as here: let's assume you have a model "company" so in controller

    $this->loadModel("company");
    $c = new company;
    
    $company = $c->find(array("select" => "what you want", "where" => "your statement"));
    

    bye

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

报告相同问题?

悬赏问题

  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题
  • ¥15 github训练的模型参数无法下载
  • ¥15 51单片机显示器问题
  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案
  • ¥50 winform中使用edge的Kiosk模式
  • ¥15 关于#python#的问题:功能监听网页