2
從MySQL顯示的字符的數量,查詢數據庫的代碼是:限制我有正在通過的Coldfusion顯示MySQL數據庫中的ColdFusion
<cfquery name="GetWp_posts" datasource="#session.odbcname#">
SELECT post_content
FROM wp_posts
ORDER by ID desc
LIMIT 0, 2 </cfquery>
顯示的結果的代碼是:
<cfoutput query="getWp_posts">
<cfif trim(getWp_posts.post_content) is not ""><div class = "courseShortDesc">#getWp_posts.post_content#</div></cfif>
</cfoutput>
如何限制顯示在結果中的字符數量?
非常感謝
這是偉大的 - 即做的工作。非常感謝 – elixireu 2011-04-04 16:51:47
如果可以,請檢查回答的問題。 – 2011-04-04 18:32:13
您可能還想看看CFLib上的http://cflib.org/udf/FullLeft。這是一個增強的left(),它不會切斷單詞,如果這是您需要的。 – 2011-04-04 18:54:58