Php 更新数据时如何修复“where子句”中的“未知列”数组-Codeigniter

Php 更新数据时如何修复“where子句”中的“未知列”数组-Codeigniter,php,codeigniter,email,Php,Codeigniter,Email,我在CodeIgniter中创建了一个小型应用程序,在这个应用程序中,我正在创建一个忘记密码模块。 我已经创建了一个函数,但不知道为什么它不工作;我需要随机的,自动生成的密码在电子邮件中发送出去,但当我点击提交按钮时,它会显示数组到字符串的转换错误,所以给我一些建议 这是我的看法 重置密码 我的控制器 公用函数忘记密码{ $email=$this->input->post'email'; $result=$this->Authentication\u model->check\u email$e

我在CodeIgniter中创建了一个小型应用程序,在这个应用程序中,我正在创建一个忘记密码模块。 我已经创建了一个函数,但不知道为什么它不工作;我需要随机的,自动生成的密码在电子邮件中发送出去,但当我点击提交按钮时,它会显示数组到字符串的转换错误,所以给我一些建议

这是我的看法

重置密码 我的控制器

公用函数忘记密码{ $email=$this->input->post'email'; $result=$this->Authentication\u model->check\u email$email; 如果$result{ $this->sendpassword$result; $this->session->set_flashdata'success','Password已重置并已发送到您的电子邮件:'。$email; 重定向“身份验证/查看”; }否则{ $this->session->set_flashdata‘error’,‘在我们的数据库中找不到您输入的电子邮件’; 重定向“身份验证/查看”; } } 公共函数sendpassword$result{ 日期默认时区设置为GMT; $this->load->helper'string'; $password=随机字符串'alnum',16; $this->db->where'email',$result; $this->db->update'users',$password; $this->load->library'email'; $this->email->from'cantreply@youdomain.com“你的名字”; $this->email->to$user->email; $this->email->subject'Password reset'; $this->email->message“您已请求新密码,这是您的新密码:”。$password; $this->email->send; } 还有我的模特

功能检查\u电子邮件$email{ $this->db->选择“*”; $this->db->来自“用户”; $this->db->where'email',$email; $this->db->limit1; $query=$this->db->get; 如果$query->num_rows==1{ 返回$query->result; }否则{ 返回false; } }
请澄清电子邮件方法如何不起作用,和/或从何处获得数组到字符串转换错误,即包括完整错误。我怀疑数组是由您的随机字符串函数返回的-请也包括这个,以便我们可以检查。是的,对不起,我已经编辑了消息,谢谢请也包括随机字符串函数代码。带有Where子句的SQL语句在哪里?请也包括这一点。我已经在我的函数public function sendpassword$resultp中说明了这一点。请澄清电子邮件方法如何不起作用,和/或从何处获得数组到字符串转换错误,即包括完整错误。我怀疑数组是由您的随机字符串函数返回的-请也包括这个,以便我们可以检查。是的,对不起,我已经编辑了消息,谢谢请也包括随机字符串函数代码。带有Where子句的SQL语句在哪里?请也包括这一点。我已经在我的函数public function sendpassword$result中说明了这一点