You would store the data in a variable, then use the variable to send the data to the database server, then use the variable to send an email.
http://us3.php.net/mysql
http://us3.php.net/manual/en/tutorial.forms.php
http://www.php.net/links.php
Here's a mock up:
<?php
$data = $_POST['data'];
$db = mysql_connect($host, $user, $password)
mysql_query("INSERT INTO table (data) VALUES ($data)", $db)or DIE("Could not insert $data");
$mailData = "$data inserted into database";
mail('me@example.com', 'Query Results!', $mailData) or DIE ("Could not send email!");
?>
|