Skip to main content
Inspiring
November 15, 2007
Answered

PHP Mail: Recordset Field in Message

  • November 15, 2007
  • 2 replies
  • 320 views
So I'm just learning to work with PHP in DW C3 and I'm stumped how to include a field from my recordset in the message.

As you can see, my email message is a typical password reset. I want to include the password in the body of the message here:

$message .="Password: \n";

What's the syntax?

Thank you
This topic has been closed for replies.
Correct answer jasons
Figured it out:

Just added

$password = $row_rs_password['password'];

and then updated the message:

$message .="Password: $password \n\n";

2 replies

jasonsAuthorCorrect answer
Inspiring
November 15, 2007
Figured it out:

Just added

$password = $row_rs_password['password'];

and then updated the message:

$message .="Password: $password \n\n";

Inspiring
November 15, 2007
jasons wrote:
> What's the syntax?

$message .="Password: $row_rs_password[password]\n";

You need to remove the quotes from the name of the array element because
it's inside a double-quoted string. The quotes are normally required
inside the square brackets, but if you use them here, the variable is
not interpolated. A strange quirk of PHP syntax.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
jasonsAuthor
Inspiring
November 15, 2007
Thanks David!