迅睿開源框架是一款PHP8高性能·簡單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計理念, 支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
我在show頁面寫了一個sql語句循環(huán),select條件里面用了當(dāng)前文章的ID,請問select語句里面能用變量嗎?
<?php $query=urlencode('select * from @#member where username="admin"');?> {sql sql='$query'} {$t.username} {/sql} {$debug}
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)@迅睿框架技術(shù)-岳老師 不能直接用{$id}嗎?
回復(fù)@迅睿框架技術(shù)-岳老師
<?php $query=urlencode('select * from xx_1_xxgl_from_ck where cid=$id');?> {sql sql='$query'} {$t.title} {/sql}
感覺沒問題啊,我把$id直接寫成數(shù)值就沒問題,我這樣寫報錯了,請指教
是在show頁面查詢模塊表單數(shù)據(jù)
<?php $query=urlencode('select * from xx_1_xxgl_from_ck where cid='.$id);?>
老師說的話你沒有聽進去
回復(fù)@GoWorkRoom 我是兩個select字句,用了union all,'.會切斷,大神甩個例子被,謝謝
<?php $query=urlencode('select * from xx_1_xxgl_from_ck1 where cid=$id' union all select * from xx_1_xxgl_from_ck2 where cid=$id');?>
<?php $query=urlencode('select * from xx_1_xxgl_from_ck1 where cid='.$id.' union all select * from xx_1_xxgl_from_ck2 where cid='.$id);?>
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)@迅睿框架技術(shù)-岳老師 不能直接用{$id}嗎?
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)@迅睿框架技術(shù)-岳老師
<?php $query=urlencode('select * from xx_1_xxgl_from_ck where cid=$id');?> {sql sql='$query'} {$t.title} {/sql}感覺沒問題啊,我把$id直接寫成數(shù)值就沒問題,我這樣寫報錯了,請指教
是在show頁面查詢模塊表單數(shù)據(jù)
<?php $query=urlencode('select * from xx_1_xxgl_from_ck where cid='.$id);?>老師說的話你沒有聽進去
回復(fù)@GoWorkRoom 我是兩個select字句,用了union all,'.會切斷,大神甩個例子被,謝謝
<?php $query=urlencode('select * from xx_1_xxgl_from_ck1 where cid=$id' union all select * from xx_1_xxgl_from_ck2 where cid=$id');?><?php $query=urlencode('select * from xx_1_xxgl_from_ck1 where cid='.$id.' union all select * from xx_1_xxgl_from_ck2 where cid='.$id);?>