Fill my mail with database-variables ?!!!?
Posted: Thu Feb 05, 2004 1:39 pm
My problem is as follows:
I can't get my mail-function to work properly.
Here is my code and my question:
So basically I have info from my 'orders' table which I want to insert into my mail.
The following code:
doesn't seem to do the trick.
What am I missing here???
I can't get my mail-function to work properly.
Here is my code and my question:
Code: Select all
$toaddress = 'tome@me.com';
$subject = 'my subject';
$db = mysql_connect('localhost', 'user', '') or die(mysql_error());
mysql_select_db('database') or die(mysql_error());
$query = "SELECT * FROM orders ORDER BY orderid DESC LIMIT 1";
$result = mysql_query($query) or die("SELECT Error: ".mysql_error());
$num_results = mysql_num_rows($result);
for ($i=0; $i < $num_results; $i++)
{
$row = mysql_fetch_array($result);
mysql_close($db);
}The following code:
Code: Select all
mail ($toaddress, $subject, $row);What am I missing here???