【问题标题】:Retrieve Tags from db phalcon从 db phalcon 检索标签
【发布时间】:2016-04-02 07:04:55
【问题描述】:

我正在用 phalcon 实现一个博客。有一个标签字段,后跟: https://github.com/mfiels/tagsly/blob/master/index.html

它在数据库中插入多个值。但不明白如何从标签字段中检索数组值。

我想呈现所有标签列表,如果用户点击该标签,那么它应该呈现所有相关帖子的列表。我的意思是在函数中我无法理解它 $tags = Blogs::find();如何使用 like 子句查找数组值?还是我错了?或者有什么简单的方法吗?请...

My db looks like this

【问题讨论】:

    标签: php mysql database tags phalcon


    【解决方案1】:

    您是否尝试过类似的方法:

    $result = Blogs::find([
        'tag LIKE :tag:',
        'bind' => ['tag' => $tag],
    ]);
    

    【讨论】:

      猜你喜欢
      • 2016-07-23
      • 2013-09-09
      • 1970-01-01
      • 2014-05-23
      • 2019-05-10
      • 1970-01-01
      • 2017-01-09
      • 2018-06-10
      • 1970-01-01
      相关资源
      最近更新 更多