Welcome to Dream.In.Code
Become an Expert!

Join 149,882 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,323 people online right now. Registration is fast and FREE... Join Now!




display 2 list of suppliers depending on supplier type

 
Reply to this topicStart new topic

display 2 list of suppliers depending on supplier type, display 2 list of suppliers depending on supplier type

ksnight
29 Jan, 2007 - 07:19 AM
Post #1

New D.I.C Head
*

Joined: 29 Jan, 2007
Posts: 4


My Contributions
Here is the code I have to list one type of supplier. I would like to list both types of suppliers on the page in different tables. I would assume that I would need to remove the "WHERE type1Supplier=-1" from the select statement. After I do that I am lost. I have thought about the different way's this could be done but nothing that I have tried seems to work.

CODE
<%

on error resume next

' brings suppliers by type

mySQL="SELECT * FROM suppliers WHERE SupplierType1=-1 ORDER BY supplierName"

call getFromDatabase(mySQL, rstemp, "listSupplierType1.asp")

%>

<!-- Display suppliers by type -->
<br><b>Type 1 Suppliers </b>
<%do while not rstemp.eof%>
<br /><br />
<a href="listProductsBySupplier.asp?idSupplier=<%=rstemp("idSupplier")%>"><%=rstemp("supplierName")%></a>
  <%
rstemp.movenext
loop
call closeDb()
%>



I need to have two list that display two different types of suppliers not just one. Example would be a list of computer suppliers and another list of printer suppliers. Both list should direct the user to that suppliers page.

I have tried to make two different asp pages and include each in its own table but it times out when both pages are included. Works good with just one include. I would like to have a table cell display one supplier type and the other cell display the 2nd supplier type their are four different supplier types.


This post has been edited by ksnight: 29 Jan, 2007 - 11:40 AM
User is offlineProfile CardPM
+Quote Post

sontek
RE: Display 2 List Of Suppliers Depending On Supplier Type
31 Jan, 2007 - 12:16 AM
Post #2

D.I.C Regular
Group Icon

Joined: 13 Sep, 2001
Posts: 283



Thanked: 1 times
Dream Kudos: 85
My Contributions
QUOTE(ksnight @ 29 Jan, 2007 - 08:19 AM) *

Here is the code I have to list one type of supplier. I would like to list both types of suppliers on the page in different tables. I would assume that I would need to remove the "WHERE type1Supplier=-1" from the select statement. After I do that I am lost. I have thought about the different way's this could be done but nothing that I have tried seems to work.

CODE
<%

on error resume next

' brings suppliers by type

mySQL="SELECT * FROM suppliers WHERE SupplierType1=-1 ORDER BY supplierName"

call getFromDatabase(mySQL, rstemp, "listSupplierType1.asp")

%>

<!-- Display suppliers by type -->
<br><b>Type 1 Suppliers </b>
<%do while not rstemp.eof%>
<br /><br />
<a href="listProductsBySupplier.asp?idSupplier=<%=rstemp("idSupplier")%>"><%=rstemp("supplierName")%></a>
  <%
rstemp.movenext
loop
call closeDb()
%>



I need to have two list that display two different types of suppliers not just one. Example would be a list of computer suppliers and another list of printer suppliers. Both list should direct the user to that suppliers page.

I have tried to make two different asp pages and include each in its own table but it times out when both pages are included. Works good with just one include. I would like to have a table cell display one supplier type and the other cell display the 2nd supplier type their are four different supplier types.




You need to remove your where clause and put the returned data into a recordset so you can foreach through it and then output the links for each one dynamically.
User is offlineProfile CardPM
+Quote Post

ksnight
RE: Display 2 List Of Suppliers Depending On Supplier Type
31 Jan, 2007 - 06:09 AM
Post #3

New D.I.C Head
*

Joined: 29 Jan, 2007
Posts: 4


My Contributions
I actually figured it out.

With the default page and the two different list pages the database was being closed three times and only needed to be closed once. That was making the page time out.

So call the close function only once.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 12:01PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month