联系官方销售客服
1835022288
028-61286886
我sql语句条件语句是这个
{sql sql='select * from @#1_school where id={$t.diaoqu1}'} <div class="ycasedet_info" id="dianhua"> <p>答:{$t.dianqu1}位于{$t.dizhi}位置,下面是小编个人整理的位置地图,希望可以帮助到您</p><p><img src="{dr_get_file($t.weizhitupian)}" alt="{$t.title}位置图" /></p> </div> {/sql}
报错是这个
ERROR - 2021-02-03 10:30:05 --> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=<?php echo ; ?>' at line 1 #SQL:select * from dr_1_school where id=<?php echo ; ?> #URL:http://wz.entem.cn/index.php?s=schoolnews&c=html&m=show&catids=2&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=show_index&app=schoolnews&pagesize=10&id_form=&id_to=&date_form=&date_to=&catids[]=2 #0 /wwwroot/xunruiCMS/dayrui/System/Database/MySQLi/Connection.php(314): mysqli->query() #1 /wwwroot/xunruiCMS/dayrui/System/Database/BaseConnection.php(697): CodeIgniter\Database\MySQLi\Connection->execute() #2 /wwwroot/xunruiCMS/dayrui/System/Database/BaseConnection.php(625): CodeIgniter\Database\BaseConnection->simpleQuery() #3 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(2143): CodeIgniter\Database\BaseConnection->query() #4 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(1047): Phpcmf\View->_query() #5 /wwwroot/xunruiCMS/cache/template/template_pc_newmoban_home_schoolnews_show-weizhi.html.cache.php(38): Phpcmf\View->list_tag() #6 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(222): include('/wwwroot/xunrui...') #7 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(437): Phpcmf\View->display() #8 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(684): Phpcmf\Home\Module->_Show() #9 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(912): Phpcmf\Home\Module->_Create_Show_Html() #10 /wwwroot/xunruiCMS/dayrui/App/Schoolnews/Controllers/Html.php(22): Phpcmf\Home\Module->_Show_Html() #11 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(931): Phpcmf\Controllers\Html->show() #12 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(427): CodeIgniter\CodeIgniter->runController() #13 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(333): CodeIgniter\CodeIgniter->handleRequest() #14 /wwwroot/xunruiCMS/dayrui/Fcms/Init.php(398): CodeIgniter\CodeIgniter->run() #15 /wwwroot/xunruiCMS/index.php(50): require('/wwwroot/xunrui...') #16 {main}
我测试
{sql sql='select * from @#1_school where id=1'} 就没有问题 内容什么的 都能出来 然后我测试 {sql sql='select * from @#1_school where id={~$t.diaoqu1~}'} 没有报错 但是没有内容 不知道值哪里出错了
ERROR - 2021-02-03 10:50:08 --> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1#SQL:select * from dr_1_school where id=#URL:http://wz.entem.cn/index.php?s=schoolnews&c=html&m=show&catids=2&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=show_index&app=schoolnews&pagesize=10&id_form=&id_to=&date_form=&date_to=&catids%5B%5D=2#0 /wwwroot/xunruiCMS/dayrui/System/Database/MySQLi/Connection.php(314): mysqli->query()#1 /wwwroot/xunruiCMS/dayrui/System/Database/BaseConnection.php(697): CodeIgniter\Database\MySQLi\Connection->execute()#2 /wwwroot/xunruiCMS/dayrui/System/Database/BaseConnection.php(625): CodeIgniter\Database\BaseConnection->simpleQuery()#3 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(2143): CodeIgniter\Database\BaseConnection->query()#4 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(1047): Phpcmf\View->_query()#5 /wwwroot/xunruiCMS/cache/template/template_pc_newmoban_home_schoolnews_show-weizhi.html.cache.php(40): Phpcmf\View->list_tag()#6 /wwwroot/xunruiCMS/dayrui/Fcms/Core/View.php(222): include('/wwwroot/xunrui...')#7 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(437): Phpcmf\View->display()#8 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(684): Phpcmf\Home\Module->_Show()#9 /wwwroot/xunruiCMS/dayrui/Fcms/Control/Home/Module.php(912): Phpcmf\Home\Module->_Create_Show_Html()#10 /wwwroot/xunruiCMS/dayrui/App/Schoolnews/Controllers/Html.php(22): Phpcmf\Home\Module->_Show_Html()#11 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(931): Phpcmf\Controllers\Html->show()#12 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(427): CodeIgniter\CodeIgniter->runController()#13 /wwwroot/xunruiCMS/dayrui/System/CodeIgniter.php(333): CodeIgniter\CodeIgniter->handleRequest()#14 /wwwroot/xunruiCMS/dayrui/Fcms/Init.php(398): CodeIgniter\CodeIgniter->run()#15 /wwwroot/xunruiCMS/index.php(50): require('/wwwroot/xunrui...')#16 {main}
逻辑问题,变量1都不存在,变量2才开始定义的,变量1完全就是空白值
这个变量是从哪里来的?你在错误提示的是空值,变量不存在
-------这个问题你没有正面回答我晓猛seo
这个是我设置的字段
其中是读取的哪里数据,或者是内容页showl.lhtml当前的字段吗??