联系官方销售客服

1835022288

028-61286886

开发框架 版主:迅睿框架研发组
参考文档《语句循环》老大我在用这个语句循环的时候发现构成语句
类型:迅睿CMS 更新时间:2020-11-28 09:31:44 循环 动态

https://www.xunruicms.com/doc/425.html

参考文档:《SQL语句循环》


老大,我在用这个SQL语句循环的时候,发现构成  SQL语句的那一句,好像不能用动态参数组成?

{?php 
$query=urlencode('select * from @#1_news');
?}
{sql sql='$query' page=1 pagesize=10 urlrule=index.php?page=[page]}
{$t.title}<br>
{/sql}
{$pages}
{$debug}

image


按手册的这句查询的话,直接就错误了

{php $query=urlencode('select * from @#member where username="admin"');}
{sql sql='$query'}
{$t.username}
{/sql}
{$debug}

mysqli_sql_exception #1064

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 '@#member where username="admin"' at line 1

select * from @#member where username="admin"



image