my mail()is set to "Content-type: text/html"
I am not sure what r/n/r/n is and how does this script dynamically define a variable that has the exact amout of results from the query with a possibility of 20 results?
************this is a way better explanation for you**********
The problem:
The query returns an array of 20 results.
The results will have a value greater than 0 or less than 1
I take the results of the array create a variable that will loop through the pieces and discard any value that is less than 1.
Then I want to implode the new array (greater than 0)with <br> inbetween the pieces so I can embed in the mail() function so it will cascade vertically
example
**step 1 QUERY 1 get array from table***
// output record set results from link_doc_temp
$find_link_document=mssql_query("SELECT*
FROM temp_link_doc
WHERE document_number = '$document_number'
")
or die ("link_document failed");
while ($row2=mssql_fetch_array($find_link_document))
{
$link_document_1=$row2["link_doc_1"];
$link_document_2=$row2["link_doc_2"];
$link_document_3=$row2["link_doc_3"];
$link_document_4=$row2["link_doc_4"];
$link_document_5=$row2["link_doc_5"];
$link_document_6=$row2["link_doc_6"];
$link_document_7=$row2["link_doc_7"];
$link_document_8=$row2["link_doc_8"];
$link_document_9=$row2["link_doc_9"];
$link_document_10=$row2["link_doc_10"];
$link_document_11=$row2["link_doc_11"];
$link_document_12=$row2["link_doc_12"];
$link_document_13=$row2["link_doc_13"];
$link_document_14=$row2["link_doc_14"];
$link_document_15=$row2["link_doc_15"];
$link_document_16=$row2["link_doc_16"];
$link_document_17=$row2["link_doc_17"];
$link_document_18=$row2["link_doc_18"];
$link_document_19=$row2["link_doc_19"];
$link_document_20=$row2["link_doc_20"];
}
?>
***Step 2**********
find pieces of original array $link_document_1 through $link_document_20
and discard those that are less than 1 and then implode int a string that will insert <br> inbetween each piece
*****step 3**********
Take new $string_variable and embed in mail()
mail("christopher.seidel@jerovsek.si" ,"Add Document Request_level2", "Link doc results: $string_variable" "Content-type: text/html")