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