Using links to load table

Discussion in 'Programming' started by cumupkid, Mar 1, 2008.

  1. #1
    Im trying to create links that will load different database information into display on the SAME page.

    For example when someone is at at menu page and they click the appatizers link it loads all information with the appatizercatagory from the menu table in the database, then if they click salads it loads the saladcatagory

    here is the code i have so far highlighted in red is where im trying to start the links

    <cfparam name="URL.ITEMCATAGORY" default="1">
    <cfquery name="qitemslist" datasource="pisanellos">
    SELECT *
    FROM items
    WHERE ITEMCATAGORY = <cfqueryparam value="#URL.ITEMCATAGORY#" cfsqltype="cf_sql_clob" maxlength="45">
    ORDER BY ITEMNAME ASC
    </cfquery>
    <link href="assets/style.css" rel="stylesheet" type="text/css">



    <p>&nbsp;</p>
    <p><a href="?itemcatagory=#appatizers#">appatizers</a></p>
    <p>&nbsp;</p>
    <table width="700" border="0" cellpadding="0" cellspacing="0" id="formtable">
    <tr>
    <td height="30" nowrap="nowrap" id="tdtablehead">Item Name</td>
    <td height="30" colspan="2" nowrap="nowrap" id="tdtablehead">item Description</td>
    <td width="80" height="30" align="right" id="tdtablehead">&nbsp;</td>
    <td height="30" align="right" id="tdtablehead">Price</td>
    <td height="30" align="right" id="tdtablehead">&nbsp;</td>
    </tr>
    <tr>
    <td height="30" nowrap="nowrap" id="tdtablehead2">&nbsp;</td>
    <td height="30" colspan="2" align="center" nowrap="nowrap" id="tdtablehead2">&nbsp;</td>
    <td height="30" colspan="3" align="right" id="tdtablehead2">&nbsp;</td>
    </tr>
    <cfoutput query="qitemslist" startrow="#StartRow_qitemslist#" maxrows="#MaxRows_qitemslist#">
    <tr valign="top">
    <td height="30" colspan="2">#qitemslist.itemname#</td>
    <td width="311" height="30" align="center"><div align="justify">#qitemslist.itemdescription#</div></td>
    <td height="30" colspan="2" align="right">#qitemslist.itemprice#</td>
    <td height="30" align="right">#qitemslist.itemprice2#</td>
    </tr>
    <tr valign="top">
    <td width="139" height="20" id="tdtablefooter">&nbsp;</td>
    <td height="20" colspan="3" align="center" id="tdtablefooter">&nbsp;</td>
    <td width="129" height="20" align="right" valign="bottom" id="tdtablefooter"><a href="adminusers/edititem.cfm?itemid=#qitemslist.itemid#">edit</a></td>
    <td width="40" height="20" align="right" valign="bottom" id="tdtablefooter"><a href="adminusers/deleteitem.cfm?itemid=#qitemslist.itemid#">delete</a></td>
    </tr>
    </cfoutput>
    </table>
     
    cumupkid, Mar 1, 2008 IP
  2. websiteideas

    websiteideas Well-Known Member

    Messages:
    1,406
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    130
    #2
    so, what isn't working? are you getting an error message? if so, post it.
     
    websiteideas, Mar 8, 2008 IP
  3. dshuck

    dshuck Peon

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You gave absolutely no information about what isn't working, so this is entirely a crap shoot, but perhaps it is related to the fact that you aren't setting StartRow_qitemslist and MaxRows_qitemslist. I also notice that you are misspelling a few words such as "appatizer" and "catagory", so who knows... you may have some unmatched variables related to that. If you are still having a problem, perhaps you would like to share what is actually failing.
     
    dshuck, Mar 11, 2008 IP
  4. plainME

    plainME Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If your problem hasn't been resolved yet, the key to solve this problem is, bind, and look up CFDIV (even div would do, but start with CFDIV)...

    It's really a simple problem assumed you're using cf8 ...
     
    plainME, Apr 4, 2008 IP