笔记
This commit is contained in:
30
QT/第十七章.md
Normal file
30
QT/第十七章.md
Normal file
@ -0,0 +1,30 @@
|
||||
![[第17章(2课时)已更新.ppt]]
|
||||
|
||||
第17章重点:qt连接数据库的使用。
|
||||
安装完mysql,在odbc配置数据源。
|
||||
![[92f8bd976d775f7a9b67c3c6954238f.png]]
|
||||
将lib和dll文件从mysql安装目录找到,复制到qt的安装目录下。
|
||||
![[8d3b90f415b25cbefd48f544124e91d.png]]
|
||||
![[4ece700f456523e757d44c56c6d11d2.png]]
|
||||
![[325df8980ecb953d6b11a42310eb2ae 1.png]]
|
||||
![[68834c79fd94cac9456844aabdb91e2.png]]
|
||||
|
||||
常用的一些sql语句:
|
||||
#创建数据库
|
||||
create database db_name;
|
||||
#使用数据库,也就是指定当前数据库。
|
||||
use db_name;
|
||||
#创建表
|
||||
create table tb_name (
|
||||
id int auto_increment primary key,
|
||||
name varchar(20)
|
||||
);
|
||||
#插入数据
|
||||
insert into tb_name (id, name) values (1,‘zhao’);
|
||||
#更新数据
|
||||
update tb_name set name = ‘qian’ where id = 1;
|
||||
#删除数据
|
||||
delete from tb_name where id = 1;
|
||||
#删除表
|
||||
drop table tb_name;
|
||||
|
||||
Reference in New Issue
Block a user