我之前已经解决了我的分页问题。
但不是使用
<<上一页//下一页>>
我希望它是
<< {导演ID} // {导演ID}>>
任何人都可以帮助我吗?
这是我的完整代码。 我只是想改变上一个/下一个,显示当前的电影导演。
<cfquery datasource="#dsn#" name="list">
SELECT *
FROM directorList
</cfquery>
<cfquery name="qIDHM" datasource="#dsn#">
SELECT directorID
FROM directorList
WHERE directorID = '#list.directorID#'
GROUP BY directorID
</cfquery>
<cfparam name="StartRow" default="1">
<cfset EndRow=StartRow + OnEachPage - 1>
<cfif EndRow GTE list.RecordCount>
<cfset EndRow=list.RecordCount>
<cfset Next=false>
<cfelse>
<cfset Next=true>
<cfif EndRow + OnEachPage GT list.RecordCount>
<cfset NextNum=list.RecordCount - EndRow>
<cfelse>
<cfset NextNum= OnEachPage>
</cfif>
<cfset NextStart=EndRow + 1>
</cfif>
<cfif StartRow IS 1>
<cfset Previous=false>
<cfelse>
<cfset Previous=true>
<cfset PreviousStart=StartRow - OnEachPage>
</cfif>
<cfset NumPages=Ceiling(list.RecordCount / OnEachPage)>
<cfparam name="PageNum" default="1">
<cfoutput><br><i>Display #StartRow# from #list.RecordCount# Search.</i><p>
</cfoutput>
<table border="1" >
<cfoutput query="list" startrow="#startrow#" maxrows="#OnEachPage#">
<thead>
<tr>
<th colspan="4">#list.directorID# [#qIDHM.recordCount# data]<br>#list.dirFilmTitle# </th>
</tr>
</thead>
<thead>
<tr>
<th>Film Title</th><th>Duration</th>
</thead>
<tbody>
<tr align="left">
<td>#list.dirFilmTitle#</td>
<td>#FilmDuration#</td>
</tr>
</tbody>
</tbody>
</cfoutput>
<table border="0">
<tr>
<td valign="top">
<cfif Previous>
<cfoutput>
<a href="directorPage.cfm?StartRow=#PreviousStart#&PageNum=#DecrementValue(PageNum)#<cfif IsDefined("Keyword")>&Keyword=#URLEncodedFormat(Keyword)#</cfif>"><< Previous ***(I want to put ID of director here)***</a>
</cfoutput>
<cfelse>
</cfif>
</td>
<cfloop from="1" to="#NumPages#" index="ThisPage">
<cfoutput>
<cfif ThisPage IS PageNum>
<td>#ThisPage#</td>
</cfif>
</cfoutput>
</cfloop>
<td valign="top">
<cfif Next>
<cfoutput>
<a href="directorPage.cfm?StartRow=#NextStart#&PageNum=#IncrementValue(PageNum)#<cfif IsDefined("Keyword")>&Keyword=#URLEncodedFormat(Keyword)#</cfif>">Next >></a>
</cfoutput>
<cfelse>
</cfif>
</td>
</tr>
<tr>
<td valign="top" colspan="<cfoutput>#Evaluate(NumPages + 2)#</cfoutput>">
</td>
</tr>
</table>
</table><br>