割肉相啖
// 拼装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();