Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with mlm type structure

Status
Not open for further replies.

krappleby025

Programmer
Sep 6, 2001
347
NL
hi all... i have a mlm database with so far 200 members and i am trying to create script so that them 200 members can all be emailed at once... However i just want to email them from

now the only way i can think of doing it is long winded, and here is an example of how i would do just 4 levels

-*-**************************************
<%
set query1 = con.execute(&quot;SELECT * FROM members WHERE id = &quot; & session(&quot;id&quot;) )
do until query1.EOF
'-----------------------------------------------------------------------------
set query2 = con.execute(&quot;SELECT * FROM members WHERE personalsponser = &quot; & query1(&quot;id&quot;) )
if not query2.EOF then
do until query2.EOF
test=query2(&quot;id&quot;)
ilen=len(test)
if ilen<>7 then
for i = 1 to (7-ilen)
test=&quot;0&quot; & Test
next
end if
lvl1 = lvl1 + 1
%>
<tr>
<td width=&quot;250&quot;><font size=&quot;2&quot; face=&quot;Arial&quot;>1.&nbsp;<a href=&quot;mailto:<% =query2(&quot;email&quot;) %>&quot;><% =query2(&quot;firstname&quot;) %>&nbsp;<% =query2(&quot;lastname&quot;) %></a></font></td>
<td width=&quot;50&quot; align=&quot;center&quot;><font face=&quot;Arial&quot; size=&quot;2&quot;><% =test %></font></td>
<td width=&quot;120&quot; align=&quot;center&quot;><font size=&quot;2&quot; face=&quot;Arial&quot;><% =query1(&quot;firstname&quot;) %>&nbsp;<% =query1(&quot;lastname&quot;) %></font></td>
<td width=&quot;120&quot; align=&quot;center&quot;></td>
</tr>
<%
'-----------------------------------------------------------------------------
set query3 = con.execute(&quot;SELECT * FROM members WHERE personalsponser = &quot; & query2(&quot;id&quot;) )
if not query3.EOF then
do until query3.EOF
test=query3(&quot;id&quot;)
ilen=len(test)
if ilen<>7 then
for i = 1 to (7-ilen)
test=&quot;0&quot; & Test
next
end if
lvl2 = lvl2 + 1
%>
<tr>
<td width=&quot;250&quot;><font size=&quot;2&quot; face=&quot;Arial&quot;>&nbsp;&nbsp;2.&nbsp;<a href=&quot;mailto:<% =query3(&quot;email&quot;) %>&quot;><% =query3(&quot;firstname&quot;) %>&nbsp;<% =query3(&quot;lastname&quot;) %></a></font></td>
<td width=&quot;50&quot; align=&quot;center&quot;><font face=&quot;Arial&quot; size=&quot;2&quot;><% =test %></font></td>
<td width=&quot;120&quot; align=&quot;center&quot;><font size=&quot;2&quot; face=&quot;Arial&quot;><% =query2(&quot;firstname&quot;) %>&nbsp;<% =query2(&quot;lastname&quot;) %></font></td>
<td width=&quot;120&quot; align=&quot;center&quot;></td>
</tr>
<%
'-----------------------------------------------------------------------------
set query4 = con.execute(&quot;SELECT * FROM members WHERE personalsponser = &quot; & query3(&quot;id&quot;) )
if not query4.EOF then
do until query4.EOF
test=query4(&quot;id&quot;)
ilen=len(test)
if ilen<>7 then
for i = 1 to (7-ilen)
test=&quot;0&quot; & Test
next
end if
lvl3 = lvl3 + 1
%>
<tr>
<td width=&quot;250&quot;><font size=&quot;2&quot; face=&quot;Arial&quot;>&nbsp;&nbsp;&nbsp;&nbsp;3.&nbsp;<a href=&quot;mailto:<% =query4(&quot;email&quot;) %>&quot;><% =query4(&quot;firstname&quot;) %>&nbsp;<% =query4(&quot;lastname&quot;) %></a></font></td>
<td width=&quot;50&quot; align=&quot;center&quot;><font face=&quot;Arial&quot; size=&quot;2&quot;><% =test %></font></td>
<td width=&quot;120&quot; align=&quot;center&quot;><font size=&quot;2&quot; face=&quot;Arial&quot;><% =query3(&quot;firstname&quot;) %>&nbsp;<% =query3(&quot;lastname&quot;) %></font></td>
<td width=&quot;120&quot; align=&quot;center&quot;></td>
</tr>
<%
********************************************

as i said long winded, i need, to be able to take all the records from the database, and remove the field called email from each of the records, and place them in one string, ie test(1) test(2) etc etc... so that i can create a simple script to actually add each email address to the email script...

any help would be appreciated

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top