Hello, I am working on an order form script and I am making it work with a database instead of being "hard coded". I am trying to use a db field as a variable to email. I have the following code hard coded into the script now:
PHP Code:
$mstText = "Name: $name";
mail($to, $subject, $msgText, "To: $to <$to>\n" . "From: $to <$to>\n");
I was told that the following code would do that but it doesn't work:
PHP Code:
$q = mysql_query("SELECT mess FROM order_message WHERE id=1");
list($msgText) = mysql_fetch_array($q);
mail($to, $subject, $msgText, "To: $to <$to>\n" . "From: $to <$to>\n");
Any Suggestions?
Bookmarks