Problem solved - I was being an idiot. I now have another question. Is it not possible to send tables of data in an email? I have the following in my script and would love an eqivalent on the email but I can only get it to return the last row. any chance ?
$nbrow=0;
echo "<table border=1><tr><th>Heading Code</th><th>Listings</th><th>Description</th></tr>\n";
$nbrow=0;
// fetch the succesive result rows
while( odbc_fetch_row( $cur ) )
{
$nbrow++;
$adclass= odbc_result( $cur, 1 );
$description= odbc_result( $cur, 2 );
$listings= odbc_result( $cur, 3 );
echo "<tr><td>$adclass</td><td>$description</td><td>$listings</td></tr>\n";
}