dt614037527 2012-09-05 01:08
浏览 5
已采纳

有没有执行sql的函数? 具体是CakeSchema生成的sql?

Is there a function that executes mysql? Specifically mysql generated by the CakeSchema?

This is an example of the data I want to import:

    $this->Schema = new CakeSchema();
    $Schema = $this->Schema->load();
    $db = ConnectionManager::getDataSource($this->Schema->connection);
    $contents = "

" . $db->createSchema($Schema);
  • 写回答

1条回答 默认 最新

  • dor65412 2012-09-05 01:26
    关注

    If it's actually MySQL, then just use query()

    $this->MyModel->query("CREATE TABLE ....");
    

    Because it likely doesn't really fit with one of your models, you can always make a "DataFunction" model and tell it to $useTable = false;... then store any/all of these kind of "general" functions there. Then load the model and call your function from whatever action you'd like.

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

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 shape_predictor_68_face_landmarks.dat
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料