class Application_Model_DbTable_Email extends Zend_Db_Table_Abstract
{
protected $_name = 'memberdetail';
public function sendEmail($email)
{
$email = $_POST['email'];
$userid = ($this->select('userid')
->from('usertable', 'memberdetail')
->where('usertable.userid = memberdetail.memberid AND memberdetail.memberid = (SELECT memberid FROM memberdetail WHERE email = ?)', "".$email. "'"));
$reset = new Application_Model_DbTable_Register();
$reset->resetPass($userid);
$pswd = new Application_Model_DbTable_Register();
$pswd = $pswd->getTemp();
$mail = new Zend_Mail();
$mail->setFrom('swap.test@yahoo.com.sg', 'Inexorable Beauty');
$mail->addTo($email, $email);
$mail->setSubject('Inexorable Beauty: Password Reset');
$mail->setBodyText('Dear Customer,
You have requested to reset your password.
This is the temporary password: '.$pswd.'
Please log in immediately and change your password.
Thank You.
Yours Sincerely,
Inexorable Beauty');
$mail->send();
if($mail->send())
{
echo "Email successfully sent!";
}
else
{
echo "Email was not sent";
}
}
我正在尝试获取从 memberid 引用的用户 ID。我可以通过 $_POST['email'] 的电子邮件获取 memberid。问题是,我似乎无法获得用户 ID 的值。我试图通过一个while循环来回显用户ID,但它不起作用。当我打印 SQL 时,它似乎与我写的语句不同。