Mysql语句报错Unknowncolumninfieldlist

更新时间:2023-07-07 17:29:42 阅读: 评论:0

割肉相啖
// 拼装sql语句,重点在于--->'".$urname."'
$this->sql = "inrt into $this->table (urname, password) values ('".$urname."', $password)";
return $this;
}
// 删除数据
public function delete($id)
{
$this->action = 'other';
$this->sql = "delete from $this->table where id = $id";
return $this;
英语听力材料}
/
/ 修改数据
scarf的意思public function update($id, $urname, $password)
{
$this->action = 'other';
$this->sql = "update $this->table t urname='".$urname."', password=$password where id = $id";        return $this;
}
// 之所以名称不⽤query是为了仍然可以使⽤mysqli类的query⽅法执⾏sql
public function query2()
{
// 执⾏语句
$result = $this->query($this->sql);
// 判断⽤户是什么操作
if ($this->action == 'lect') {
$data = [];naive什么意思
// 解析查询数据
foreach ($result as $key => $value) {
$two_data = [];
foreach ($value as $two_key => $two_value) {
$two_data[$two_key] = $two_value;
threat}
$data[$key] = $two_data;
}
return $data;
} el {
if($result) {
培训瑜伽教练
return $result;
} el {
美国大选2020年什么时候出结果// 输出语句错误信息
echo $this->error;
return fal;
}
}
}
norgren
}
// 建⽴与数据库的连接
高考时间2020具体时间表
$db = new MysqliClass('studymysqli');
// 设置要操作的表
$db->table = 'mysqli_class';
// 1. 查询数据
// $result = $db->lect()->query2();
// var_dump($result);
// 2. 添加数据,⽤时间戳替代密码,⽤来判断是否成功添加
// $result = $db->inrt('测试姓名', time())->query2();
// var_dump($result);
/
may/ 3. 修改数据,
// 参数解释,唯⼀标识ID, ⽤户名称urname, ⽤户密码password
// $result = $db->update(2, '修改⽤户名称', time())->query2();

本文发布于:2023-07-07 17:29:42,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/1083988.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:数据   时间   语句   解释   添加   重点   大选   修改
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图