国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

首頁 後端開發(fā) php教程 PHP SMARTY 雙循環(huán)(遞歸)輸出分類 有關(guān)問題

PHP SMARTY 雙循環(huán)(遞歸)輸出分類 有關(guān)問題

Jun 13, 2016 am 10:24 AM
gt lt quot

PHP SMARTY 雙循環(huán)(遞歸)輸出分類 問題
模版

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->{foreach from=$classlist item=newsclass}    <div class="bg03"><a href="news.php?classid=%7B%24newsclass.id%7D&%7Bif%20%24newsclass.ispro%20eq%201%7Dispro=true%7B/if%7D" target="main">{$newsclass.classname}</a></div>{/foreach}


程序
PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$sql = "select * from jh_newsclass where parentid = 0";$result = $mysqli->query($sql);while ($row = $result->fetch_row()) {    $classlist[] = array(        'id'=>$row[0],        'classname'=>$row[2],        'parentid'=>$row[1],        'ispro'=>$row[3],            );}$result->close();$mysqli->close();$smarty->assign('classlist',$classlist);$smarty->assign('webname',Webname);$smarty->display('admin/left.htm');



這樣只能輸出一級分類. 我需要在一級分類下再輸出二級..三級..該怎么寫呀??


以前用ASP輸出的效果
HTML code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->              <div class="bg03">新聞專題</div><div class="forumlist_groups"><div align="left"><ul>
<li class="forumli"><a href="news.asp?classid=3&newsclass=3" target="main">+--<img  src="/static/imghw/default1.png" data-src="images/leaf.gif" class="lazy" id="folder180"    style="max-width:90%"  style="max-width:90%" align="absmiddle" alt="PHP SMARTY 雙循環(huán)(遞歸)輸出分類 有關(guān)問題" ><font color="">新聞動態(tài)</font></a></li>
<li class="forumli"><a href="news.asp?classid=6&newsclass=6" target="main">+--<img  src="/static/imghw/default1.png" data-src="images/leaf.gif" class="lazy" id="folder180"    style="max-width:90%"  style="max-width:90%" align="absmiddle" alt="PHP SMARTY 雙循環(huán)(遞歸)輸出分類 有關(guān)問題" ><font color="">美大專題</font></a></li>
<li class="forumli"><a href="news.asp?classid=16&newsclass=16" target="main">+--<img  src="/static/imghw/default1.png" data-src="images/leaf.gif" class="lazy" id="folder180"    style="max-width:90%"  style="max-width:90%" align="absmiddle" alt="PHP SMARTY 雙循環(huán)(遞歸)輸出分類 有關(guān)問題" ><font color="">月兔專題</font></a></li>
</ul></div></div>    <div class="bg03"><a href="news.asp?classid=14&newsclass=14" target="main">供求信息</a></div>              <div class="bg03">產(chǎn)品展示</div><div class="forumlist_groups"><div align="left"><ul>
<li class="forumli"><a href="news.asp?classid=18&ispro=true&newsclass=18" target="main">+--<img  src="/static/imghw/default1.png" data-src="images/leaf.gif" class="lazy" id="folder180"    style="max-width:90%"  style="max-width:90%" align="absmiddle" alt="PHP SMARTY 雙循環(huán)(遞歸)輸出分類 有關(guān)問題" ><font color="">美大灶具</font></a></li>
<li class="forumli"><a href="news.asp?classid=19&ispro=true&newsclass=19" target="main">+--<img  src="/static/imghw/default1.png" data-src="images/leaf.gif" class="lazy" id="folder180"    style="max-width:90%"  style="max-width:90%" align="absmiddle" alt="PHP SMARTY 雙循環(huán)(遞歸)輸出分類 有關(guān)問題" ><font color="">月圖廚柜</font></a></li>
<li class="forumli"><a href="news.asp?classid=20&ispro=true&newsclass=20" target="main">+--<img  src="/static/imghw/default1.png" data-src="images/leaf.gif" class="lazy" id="folder180"    style="max-width:90%"  style="max-width:90%" align="absmiddle" alt="PHP SMARTY 雙循環(huán)(遞歸)輸出分類 有關(guān)問題" ><font color="">集成效果</font></a></li>
</ul></div></div>



原來的ASP代碼?
HTML code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->    <div class="bg03"><a href="news.php?classid=<%=rs(" id>&newsclass=" target="main"></a></div>              <div class="bg03"></div>        <div align="left"><ul>")        while not showparentclassrs.eof            response.Write"<li class="" forumli>"            set temprs = conn.execute("select * from Jh_newsclass where parentid = " & showparentclassrs("id"))            if temprs.eof and temprs.bof then                response.Write"<a href="news.php?classid=%22&showparentclassrs(%22id%22)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20showparentclassrs(%22ispro%22)%20then%20response.Write(%22&ispro=true%22)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20response.Write%22&newsclass=%22&showparentclassrs(%22id%22)&%22" target="main">" & astr & tree & "<img  src="/static/imghw/default1.png" data-src="" images class="lazy" id="" folder180    style="max-width:90%" height="" align="" absmiddle alt="PHP SMARTY 雙循環(huán)(遞歸)輸出分類 有關(guān)問題" ><font color="">" & showparentclassrs("classname")&"</font></a>"            else                response.Write astr & tree & "<img  src="/static/imghw/default1.png" data-src="" images class="lazy" id="" folder180    style="max-width:90%" height="" align="" absmiddle alt="PHP SMARTY 雙循環(huán)(遞歸)輸出分類 有關(guān)問題" >" & showparentclassrs("classname")            end if            set temprs = nothing            response.Write"</li>"            call showparentclass(astr,tree&"--",showparentclassrs("id"))        showparentclassrs.movenext        wend    response.Write("</ul></div>")    end ifend sub%><div class="clear">
                 
              
              
        
            </div>
本網(wǎng)站聲明
本文內(nèi)容由網(wǎng)友自願投稿,版權(quán)歸原作者所有。本站不承擔相應的法律責任。如發(fā)現(xiàn)涉嫌抄襲或侵權(quán)的內(nèi)容,請聯(lián)絡(luò)admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅(qū)動的應用程序,用於創(chuàng)建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發(fā)環(huán)境

Dreamweaver CS6

Dreamweaver CS6

視覺化網(wǎng)頁開發(fā)工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

華為GT3 Pro和GT4的差異是什麼? 華為GT3 Pro和GT4的差異是什麼? Dec 29, 2023 pm 02:27 PM

許多用戶在選擇智慧型手錶的時候都會選擇的華為的品牌,其中華為GT3pro和GT4都是非常熱門的選擇,不少用戶都很好奇華為GT3pro和GT4有什麼區(qū)別,下面就給大家介紹一下二者。華為GT3pro和GT4有什麼差別一、外觀GT4:46mm和41mm,材質(zhì)是玻璃鏡板+不鏽鋼機身+高分纖維後殼。 GT3pro:46.6mm和42.9mm,材質(zhì)是藍寶石玻璃鏡+鈦金屬機身/陶瓷機身+陶瓷後殼二、健康GT4:採用最新的華為Truseen5.5+演算法,結(jié)果會更加的精準。 GT3pro:多了ECG心電圖和血管及安

修復:截圖工具在 Windows 11 中不起作用 修復:截圖工具在 Windows 11 中不起作用 Aug 24, 2023 am 09:48 AM

為什麼截圖工具在Windows11上不起作用了解問題的根本原因有助於找到正確的解決方案。以下是截圖工具可能無法正常工作的主要原因:對焦助手已開啟:這可以防止截圖工具開啟。應用程式損壞:如果截圖工具在啟動時崩潰,則可能已損壞。過時的圖形驅(qū)動程式:不相容的驅(qū)動程式可能會幹擾截圖工具。來自其他應用程式的干擾:其他正在運行的應用程式可能與截圖工具衝突。憑證已過期:升級過程中的錯誤可能會導致此issu簡單的解決方案這些適合大多數(shù)用戶,不需要任何特殊的技術(shù)知識。 1.更新視窗與Microsoft應用程式商店應用程

如何修復無法連線到iPhone上的App Store錯誤 如何修復無法連線到iPhone上的App Store錯誤 Jul 29, 2023 am 08:22 AM

第1部分:初始故障排除步驟檢查蘋果的系統(tǒng)狀態(tài):在深入研究複雜的解決方案之前,讓我們先從基礎(chǔ)知識開始。問題可能不在於您的設(shè)備;蘋果的伺服器可能會關(guān)閉。造訪Apple的系統(tǒng)狀態(tài)頁面,查看AppStore是否正常運作。如果有問題,您所能做的就是等待Apple修復它。檢查您的網(wǎng)路連接:確保您擁有穩(wěn)定的網(wǎng)路連接,因為「無法連接到AppStore」問題有時可歸因於連接不良。嘗試在Wi-Fi和行動數(shù)據(jù)之間切換或重置網(wǎng)路設(shè)定(「常規(guī)」>「重置」>「重置網(wǎng)路設(shè)定」>設(shè)定)。更新您的iOS版本:

php提交表單通過后,彈出的對話框怎樣在當前頁彈出,該如何解決 php提交表單通過后,彈出的對話框怎樣在當前頁彈出,該如何解決 Jun 13, 2016 am 10:23 AM

php提交表單通過后,彈出的對話框怎樣在當前頁彈出php提交表單通過后,彈出的對話框怎樣在當前頁彈出而不是在空白頁彈出?想實現(xiàn)這樣的效果:而不是空白頁彈出:------解決方案--------------------如果你的驗證用PHP在后端,那么就用Ajax;僅供參考:HTML code

watch4pro好還是gt好 watch4pro好還是gt好 Sep 26, 2023 pm 02:45 PM

watch4pro和gt各自具有不使用的特點和適用場景,如果注重功能的全面性、高性能和時尚外觀,同時願意承擔較高的價格,那麼Watch 4 Pro可能更適合。如果對功能要求不高,更注重電池續(xù)航力和價格的合理性,那麼GT系列可能更適合。最終的選擇應根據(jù)個人需求、預算和喜好來決定,建議在購買前仔細考慮自己的需求,並參考各種產(chǎn)品的評測和比較,以做出更明智的選擇。

如何使用 iPadOS 17.4 優(yōu)化 iPad 電池壽命 如何使用 iPadOS 17.4 優(yōu)化 iPad 電池壽命 Mar 21, 2024 pm 10:31 PM

如何使用iPadOS17.4優(yōu)化iPad電池壽命延長電池續(xù)航時間是移動設(shè)備體驗的關(guān)鍵,iPad是一個很好的例子。如果您覺得iPad電池消耗速度過快,不用擔心,在iPadOS17.4中有許多技巧和調(diào)整可以顯著延長設(shè)備的運行時間。本深入指南的目標不僅僅是提供信息,而是改變您使用iPad的方式,增強您的整體電池管理,并確保您可以在無需充電的情況下更長時間地依賴您的設(shè)備。通過采用此處概述的做法,您朝著更高效、更謹慎地使用技術(shù)邁出了一步,這些技術(shù)是根據(jù)您的個人需求和使用模式量身定制的。識別主要的能量消耗者

請教怎么修改url某一參數(shù)的參數(shù)值呢?是要拆開了再拼回去嗎 請教怎么修改url某一參數(shù)的參數(shù)值呢?是要拆開了再拼回去嗎 Jun 13, 2016 am 10:24 AM

請問如何修改url某一參數(shù)的參數(shù)值呢?是要拆開了再拼回去嗎?那么請問如何修改url某一參數(shù)的參數(shù)值呢?是要拆開了再拼回去嗎?http://127.0.0.1/myo/newuser.php?mod=search&type=fastone比如現(xiàn)在我要修改mod=new要怎么做呢?------解決方案--------------------發(fā)送了請求

Microsoft正在推出Windows 11 23H2版本到有Copilot的發(fā)布預覽頻道 Microsoft正在推出Windows 11 23H2版本到有Copilot的發(fā)布預覽頻道 Sep 28, 2023 pm 07:17 PM

每個人都在期待今天的Windows1123H2發(fā)布。事實上,Microsoft剛剛啟動了發(fā)布預覽版的更新,這是正式發(fā)布階段之前最接近的頻道。被稱為Build22631的Microsoft表示,他們正在推出新的更名聊天應用程序,電話鏈接和一起玩小部件,這些小部件在過去幾個月中已在其他內(nèi)部渠道中進行了測試。 「這個新的更新將具有與Windows11版本22H2相同的服務分支和程式碼庫,並將與所有新宣布的功能累積,包括Windows中的Copilot(預覽版),」Microsoft承諾。雷德蒙官員進一

See all articles