Send PHP results in email

From: Date: Wed, 04 Dec 2002 21:58:27 +0000
Subject: Send PHP results in email
Groups: php.general 
Request: Send a blank email to php-general+get-127042@lists.php.net to get a copy of this message
Hi, I have some database fields I want to select and email. I have lines like -- $result = mysql_query("SELECT * FROM adopt_main order by idform desc limit 1"); while( $row = mysql_fetch_array ($result)) echo "".$row["first"].","; There are quite a few of these paragraphs in the page -- 15 fields. The page does just what I want. It echos the value, with commas and quotes, all ready to be inserted, but, I can'tseem to figure out how to mail it. I know I need to make all of this a variable to pass to my mail script, but how ? My mail script work fine if I define $body and send that but I can't seem to do that with this code. If I do $body = " $result = mysql_query("SELECT * FROM adopt_main order by idform desc limit 1"); while( $row = mysql_fetch_array ($result)) echo "".$row["first"].","; "; I get parse errors every time. I have tried parens, curlys, brackets -- I have been trying for a long time but end up with a parse error. I think it's because of not using proper quotes or brackets or something but my patience is gone. Cloud someone help ? malcolm

« previous php.general (#127042) next »