hallo!
I have problem with collecting data from mysql table and sending this data to e-mail.
here is my code:
mysql_connect ("host","user","pass") OR DIE ("unable to connect");
mysql_select_db ("database");
$select = "SELECT name, user, PASSWORD FROM users ORDER BY name ASC";
$query = mysql_qyery ($select) or die (mysql_error());
while ($row = mysql_fetch_array ($query)) {
$name[] = $row[0];
$user[] = $row[1];
$password[] = $row[2];
}
$message = '
<table>
<tr>
<th>name</th><th>user</th><th>password</th>
</tr>
<tr>
<td>$name[0]</td><td>$user[0]</td><td>$password[0]</td>
</tr>
</table>
';
mail('me@yahoo.com', 'office mail', $message);
ok! This is work but i get only first row from table...
how I can collect all row in html table and send to mail?
Thanks!