• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

URL Problem

Guest
Apr 24, 2006 Apr 24, 2006

Copy link to clipboard

Copied

hey, i'm in need of some help with my coldfusion code. this is the problem, i currently have a set up with increasing links depending on how much information is inputted into the database. this is the code im using to accomplish this feature.

<cfset max = 5>
<cfparam name="url.start" default="1">

<cfoutput query="info" startrow="#url.start#" maxrows="#max#">
#info.name# | #info.message# <br>
</cfoutput>

<cfset pages = ceiling(info.recordcount/max)>
<cfif pages gt 1>
<cfloop from="1" to="#pages#" index="i">
<cfoutput>
<a href="home.cfm?number=#url.n#?start=#val((i*max)-(max-1))#">#i#</a>
</cfoutput>
</cfloop>
</cfif>

Here is my error message:

Error Executing Database Query
and it points to this part of my code:

where number=#url.n#

I noticed that the increasing link number code works fine on the other pages i use it at but the code is a little different on the other pages i use it at because i have the link part set up like this:

<a href="home.cfm?start=#val((i*max)-(max-1))#">#i#</a>

and at the page im using it where i get the error i need it to be like this:

<a href="home.cfm?number=#url.n#?start=#val((i*max)-(max-1))#">#i#</a>

this is where i think the problem is at because i also noticed on the error page that the information is being read like this:

select name
from people
where number=12?start=1


and number in the database should be only 12 but for some reason coldfusion keeps reading the rest of the url and i think thats where the problem is....

could anyone help me? i would greatly appreciate any type of help...
thanks!!
TOPICS
Advanced techniques

Views

273

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Apr 24, 2006 Apr 24, 2006
Use the ampersand & rather than a question mark ? to supply second and subsequent additional URL parms

Votes

Translate

Translate
Contributor ,
Apr 24, 2006 Apr 24, 2006

Copy link to clipboard

Copied

Use the ampersand & rather than a question mark ? to supply second and subsequent additional URL parms

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 24, 2006 Apr 24, 2006

Copy link to clipboard

Copied

LATEST
thanks a lot man, i read somewhere about the & in the url but i wasnt sure how exactly it worked. thanks again!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation