Hi James,

Please bear with my limited knowledge of PHP...

Does anyone know if it is possible to code a sql query within the message
part of the mail function, e.g.:

mail( "$to_mail","$sumject","

$sql = mysql_query("select * from table")
or   die("error with query\n");

       while ($row  =  mysql_fetch_array($sql)) {
       $db_name=$row["name"];
       $db_email=$row["email"];
       $db_age=$row["age"];

       echo"$name - $email - $age";

       }

" );

This obviously is wrong, does anyone know if its possible, if so, what is
the right way of writing it??


=What's wrong with:
$sql = mysql_query("select * from table")
or   die("error with query\n");
       while ($row  =  mysql_fetch_array($sql)) {
       $db_name=$row["name"];
       $db_email=$row["email"];
       $db_age=$row["age"];
       }
etc...
mail( "$to_mail","$sumject","$name - $email - $age" );

Regards,
=dn



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to