node中mysql的增删改查

查询数据库某表所有数据

select * from users

根据条件查询数据 where 后面可以跟条件 ?占位,最终传递真实id

select * from users where id=?

为数据库某表增加数据 ? 代表占位,最终要传要增加的数据

insert into users set ?

更新数据 第一个?占位 更新的数据 第二个占位 id

update users set ? where id=?

删除数据库数据

delete from  users where name="zhangsan"

猜你喜欢

转载自blog.csdn.net/weixin_41819098/article/details/89516547