<tfoot id='iscVe'></tfoot>
      <bdo id='iscVe'></bdo><ul id='iscVe'></ul>

    1. <small id='iscVe'></small><noframes id='iscVe'>

      <legend id='iscVe'><style id='iscVe'><dir id='iscVe'><q id='iscVe'></q></dir></style></legend>
      <i id='iscVe'><tr id='iscVe'><dt id='iscVe'><q id='iscVe'><span id='iscVe'><b id='iscVe'><form id='iscVe'><ins id='iscVe'></ins><ul id='iscVe'></ul><sub id='iscVe'></sub></form><legend id='iscVe'></legend><bdo id='iscVe'><pre id='iscVe'><center id='iscVe'></center></pre></bdo></b><th id='iscVe'></th></span></q></dt></tr></i><div id='iscVe'><tfoot id='iscVe'></tfoot><dl id='iscVe'><fieldset id='iscVe'></fieldset></dl></div>

    2. joomla sql 查询

      joomla sql query(joomla sql 查询)
    3. <small id='l7kW9'></small><noframes id='l7kW9'>

        <legend id='l7kW9'><style id='l7kW9'><dir id='l7kW9'><q id='l7kW9'></q></dir></style></legend>
              <tbody id='l7kW9'></tbody>

            • <i id='l7kW9'><tr id='l7kW9'><dt id='l7kW9'><q id='l7kW9'><span id='l7kW9'><b id='l7kW9'><form id='l7kW9'><ins id='l7kW9'></ins><ul id='l7kW9'></ul><sub id='l7kW9'></sub></form><legend id='l7kW9'></legend><bdo id='l7kW9'><pre id='l7kW9'><center id='l7kW9'></center></pre></bdo></b><th id='l7kW9'></th></span></q></dt></tr></i><div id='l7kW9'><tfoot id='l7kW9'></tfoot><dl id='l7kW9'><fieldset id='l7kW9'></fieldset></dl></div>

                <bdo id='l7kW9'></bdo><ul id='l7kW9'></ul>

                <tfoot id='l7kW9'></tfoot>
                本文介绍了joomla sql 查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                好的,所以我对 sql 了解不多,但我正在尝试为我的网站进行动态重定向,想法是将每个用户重定向到与用户调用的名称相同的文章,所以这里有一些代码,但我不知道知道如何完成它:(

                ok so i dont know much about sql but im trying to make a dinamic redirect for my website, the idea is to redirect each user to an article called the same as the user is called, so here's a little code but i dont know how to finish it :(

                $database->setQuery("SELECT id "." FROM #__content "." WHERE state='1' "." ");
                $rows = $database->loadObjectList();
                foreach($rows as $user_name){   
                $article_id = $row->id; 
                break;
                }
                $redirect_url = 'index.php?option=com_content&view=article&id='.$article_id;
                

                $user_name 和 $redirect_url 是预制"选项,所以不用担心,我只需要知道如何实际执行查询嘿嘿,感谢您的帮助 :D

                $user_name and $redirect_url are "premade" options so dont worry about it, i just need to know how to actually do the query hehe, thanks for the help :D

                推荐答案

                看起来你打算返回单个 article_id,这样 SQL 查询应该总是返回单行(值),在这种情况下,foreach 必须消失.问题是您需要重写 SQL 查询并向 WHERE 子句添加另一个条件.也许是这样的:

                It looks like you intend to return a single article_id, so that SQL query should always return a single row (value), in which case, that foreach must disappear. The thing is that you need to rewrite your SQL query and add another condition to the WHERE clause. Perhaps something like this:

                $user =& JFactory::getUser();
                $database->setQuery("SELECT id FROM #__content WHERE state='1' AND title = '".$user->name."'");
                $row = $database->loadAssoc();
                $redirect_url = 'index.php?option=com_content&view=article&id='.$row['id'];
                

                请注意,我没有测试过上面的代码.

                Please note that I have not tested the above code.

                这篇关于joomla sql 查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <i id='oVHON'><tr id='oVHON'><dt id='oVHON'><q id='oVHON'><span id='oVHON'><b id='oVHON'><form id='oVHON'><ins id='oVHON'></ins><ul id='oVHON'></ul><sub id='oVHON'></sub></form><legend id='oVHON'></legend><bdo id='oVHON'><pre id='oVHON'><center id='oVHON'></center></pre></bdo></b><th id='oVHON'></th></span></q></dt></tr></i><div id='oVHON'><tfoot id='oVHON'></tfoot><dl id='oVHON'><fieldset id='oVHON'></fieldset></dl></div>
                    <legend id='oVHON'><style id='oVHON'><dir id='oVHON'><q id='oVHON'></q></dir></style></legend>
                  • <small id='oVHON'></small><noframes id='oVHON'>

                    <tfoot id='oVHON'></tfoot>

                      <bdo id='oVHON'></bdo><ul id='oVHON'></ul>

                          <tbody id='oVHON'></tbody>