联系官方销售客服

1835022288

028-61286886

开发框架 版主:迅睿框架研发组
我这个语句为什么报错了我用方法我应该怎么改
类型:迅睿CMS 更新时间:2021-02-26 10:13:15 php urlencode
{php $query=urlencode('select * from dede_archives where id in(12,16,14,18)');}
                                        {sql db=dede sql='$query'}
                                        <p>
                                            <a href="{$t.url}" target="_blank" title="{$t.title}">
                                                {$t.title}
                                            </a><em>{$t.pubdate}</em>
                                        </p>
                                        {/sql}

我这个语句为什么报错了,我用id in 方法 我应该怎么改

回帖
  • 迅睿框架技术-吴金辉
    #1楼    迅睿框架技术-吴金辉
    2021-02-09 12:48:34
    Chrome 0
    这个写法没有任何错误,看看你错误截图
  • 晓猛seo
    #2楼    晓猛seo
    2021-02-09 12:51:43
    Chrome 0
    迅睿框架技术-吴金辉
    ERROR - 2021-02-09 12:49:58 --> Error connecting to the database: Access denied for user '****'@'%' to database 'dede'
    CRITICAL - 2021-02-09 12:49:58 --> Unable to connect to the database.
    #SQL:SELECT * FROM `dr_1_school` WHERE `dr_1_school`.`catid` = 2 AND `dr_1_school`.`status` = 9 ORDER BY `dr_1_school`.`updatetime` DESC 
    #URL:http://wz.entem.cn/index.php?c=html&m=category&ids=&pp=1
    #AGENT:Mozilla/5.0 (Windows NT 10.0 Win64 x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36
    #REFERER:http://wz.entem.cn/admin.php?c=html&m=category_index&
    #0 /wwwroot/xunruiCMS/dayrui/System/Database/BaseConnection.php(602): CodeIgniter\Database\BaseConnection->initialize()
    #1 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(2143): CodeIgniter\Database\BaseConnection->query()
    #2 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(1047): Phpcmf\View->_query()
    #3 /wwwroot/xunruiCMS/cache/template/template_pc_newmoban_home_xila.html.cache.php(350): Phpcmf\View->list_tag()
    #4 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(222): include('/wwwroot/xunrui...')
    #5 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(215): Phpcmf\View->display()
    #6 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(638): Phpcmf\Home\Module->_Category()
    #7 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(978): Phpcmf\Home\Module->_Create_Category_Html()
    #8 /wwwroot/xunruiCMS/dayrui/Core/Controllers/Html.php(15): Phpcmf\Home\Module->_Category_Html()
    #9 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(931): Phpcmf\Controllers\Html->category()
    #10 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(427): CodeIgniter\CodeIgniter->runController()
    #11 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(333): CodeIgniter\CodeIgniter->handleRequest()
    #12 /wwwroot/xunruiCMS/dayrui/Fcms/Init.php(398): CodeIgniter\CodeIgniter->run()
    #13 /wwwroot/xunruiCMS/index.php(50): require('/wwwroot/xunrui...')
    #14 {main}
  • 迅睿框架技术-吴金辉
    #3楼    迅睿框架技术-吴金辉
    2021-02-09 13:28:41
    小米手机 0
    无法连接到数据库dede,检查账号和密码。
  • 晓猛seo
    #4楼    晓猛seo
    2021-02-09 14:17:03
    Chrome 0
    迅睿框架技术-吴金辉 我检查了 账号和密码 没有问题 我测试用Navicat 工具连接数据库 也正常 但是就不知道为什么会报错
    ERROR - 2021-02-09 14:13:37 --> Error connecting to the database: Access denied for user '****'@'%' to database 'dede'
    CRITICAL - 2021-02-09 14:13:37 --> Unable to connect to the database.
    #SQL:SELECT * FROM `dr_1_school` WHERE `dr_1_school`.`catid` = 2 AND `dr_1_school`.`status` = 9 ORDER BY `dr_1_school`.`updatetime` DESC 
    #URL:http://wz.entem.cn/index.php?c=html&m=category&ids=&pp=1
    #AGENT:Mozilla/5.0 (Windows NT 10.0 Win64 x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36
    #REFERER:http://wz.entem.cn/admin.php?c=html&m=category_index&
    #0 /wwwroot/xunruiCMS/dayrui/System/Database/BaseConnection.php(602): CodeIgniter\Database\BaseConnection->initialize()
    #1 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(2143): CodeIgniter\Database\BaseConnection->query()
    #2 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(1047): Phpcmf\View->_query()
    #3 /wwwroot/xunruiCMS/cache/template/template_pc_newmoban_home_xila.html.cache.php(350): Phpcmf\View->list_tag()
    #4 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(222): include('/wwwroot/xunrui...')
    #5 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(215): Phpcmf\View->display()
    #6 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(638): Phpcmf\Home\Module->_Category()
    #7 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(978): Phpcmf\Home\Module->_Create_Category_Html()
    #8 /wwwroot/xunruiCMS/dayrui/Core/Controllers/Html.php(15): Phpcmf\Home\Module->_Category_Html()
    #9 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(931): Phpcmf\Controllers\Html->category()
    #10 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(427): CodeIgniter\CodeIgniter->runController()
    #11 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(333): CodeIgniter\CodeIgniter->handleRequest()
    #12 /wwwroot/xunruiCMS/dayrui/Fcms/Init.php(398): CodeIgniter\CodeIgniter->run()
    #13 /wwwroot/xunruiCMS/index.php(50): require('/wwwroot/xunrui...')
    #14 {main}
  • 易学习
    #5楼    易学习
    2021-02-09 14:52:21
    Chrome 0
    Error connecting to the database: Access denied for user '****'@'%' to database 'dede'
    连不上数据库dede,密码哪里错了吧
  • 晓猛seo
    #6楼    晓猛seo
    2021-02-09 14:59:14
    Chrome 0
    易学习

    是我根据这个设置得到 我以为cms2是随便起的 后来通过测试这个要填写数据库名称 已经解决了 谢谢
    满意答案
  • 晓猛seo
    #7楼    晓猛seo
    2021-02-26 10:13:15
    Chrome 0
    @晓猛seo:还是自己解决的,