Re: Re: Email DataBase Results

From: Date: Mon, 21 Apr 2003 21:43:28 +0000
Subject: Re: Re: Email DataBase Results
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-144728@lists.php.net to get a copy of this message
Thank you so much. I have no problems generating html mail, sorry for the incomplete example. Salah's assistance resulted in a complete result set. It does not break at the end of the row, however. I wonder why? -->$msg.="$variable1 - $variable2 - $variable3 \n";<-- This new example only returns the last row of data. I have great success doing that. I need all the rows of data, and preferably in individual variables so that I can insert this in an html table, and email the results via the mail function. Peace Upon You ruusvuu@whitney.dns2go.com wrote: > $headers .= "Content-Type: text/html; charset=iso-8859-1"; > > Quoting Robert Pruitt <rpruitt@Mid-tn.com>: > > > Thank-you Salah. I apologize for having to amend my question. It was > > poorly asked. > > > > Here's what I really want. > > > > mail("joecool@example.com", > > "My Subject", > > > > "<table><tr><td>Head1</td><td>Head2</td><td>Head3</td></tr> > > > > > > <tr><td>$variable1</td><td>$variable2</td><td>$variable3</td></tr></table>"); > > > > I'm a bit confused. > > > > Peace Upon You > > > > Salah Faya wrote: > > > > > Collect all data rows in one variable first, Try this: > > > > > > $query = "select * from table"; > > > $result = mysql_db_query("$dbName", $query); > > > $msg = ''; > > > while ($r = mysql_fetch_array($result)) { > > > $variable1 = $r["variable1"]; > > > $variable2 = $r["variable2"]; > > > $variable3 = $r["variable3"]; > > > $msg.="$variable1 - $variable2 - $variable3 \n"; > > > } > > > > > > mail("joecool@example.com", "My Subject", $msg); > > > > > > ----- Original Message ----- > > > From: "Robert Pruitt" <rpruitt@Mid-tn.com> > > > To: <php-general@lists.php.net> > > > Sent: Monday, April 21, 2003 10:59 PM > > > Subject: [PHP] Email DataBase Results > > > > > > > $query = "select * from table"; > > > > $result = mysql_db_query("$dbName", $query); > > > > while ($r = mysql_fetch_array($result)) { > > > > $variable1 = $r["variable1"]; > > > > $variable2 = $r["variable2"]; > > > > $variable3 = $r["variable3"]; > > > > } > > > > > > > > mail("joecool@example.com", "My Subject", "$variable1 - > > > > $variable2 - > > > > $variable3"); > > > > > > > > > > > > What is the best way to include the results of this query into the > > > > mail() function? > > > > > > > > The above trial will not give full results.

« previous php.general (#144728) next »