Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Counting to a 2 dimensional array. Im well stuck
Old 08-16-2005, 07:43 AM Counting to a 2 dimensional array. Im well stuck
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
Hi. I have a problem creating underline code require to create a 2 dimensional array that is basically a count.

I have 2 tables. portals and referals. each portal has a referal against it.
I wish to count the number of different referals for each portal.


Could someone please help me with this.

I originaly thought that I should pick up the different types of referal and write to an array ('get referals) and then step through the portal recordset and update the matching referal element in the array with +1 each time a matching referal is found in there portal recordset.

Im completely lost in doing this though not fully understanding how I manipulate the array.

My attempt to coide this has failed obviously with gaps. If someone could help me with this it would be much appreciated.

Code:
sub getStats()  
    'get the referals
    Set RS = Server.CreateObject("ADODB.Recordset") 
    strSQL = "SELECT * FROM referals"
    RS.Open strSQL, Conn 
	arrayCol=0
	arrayRow=0
	RS.MoveFirst 
	
	do while not RS.EOF
	      myArray(arrayRow, arrayCol)=RS("referal")
		  arrayRow=arrayRow+1 
             RS.movenext 
	loop
    'get the portal here and then step through array and update a total
	set RS=nothing
	Set RS = Server.CreateObject("ADODB.Recordset") 
	strSQL = "SELECT * FROM comments where portal="request.queryString("portal")
	RS.Open strSQL, Conn 
	RS.MoveFirst  
	
	do while not RS.EOF
	     
    RS.movenext
	loop
	
end sub
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 08-16-2005, 08:11 AM
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
sorry can you for get this question. wibble dribble
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 08-16-2005, 07:47 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
I find that rs.getrows() which creates a 2 dimension array works perfectly well
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Counting to a 2 dimensional array. Im well stuck
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17502 seconds with 12 queries