2 Replies Latest reply on Apr 24, 2006 3:36 PM by WOLFcfm

    URL Problem

    WOLFcfm Level 1
      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!!