先发表结构:
create table if not exists movieticket
(moviehall enum('一号厅', '二号厅', '三号厅', '五号厅') not null,
seatrow int unsigned not null,
seatcol int unsigned not null,
sellerid int unsigned not null, #售票员
moviename varchar(50) not null, #影片
movienameex enum('数字', '3D') not null, #影片扩展名
seattype enum('普通区') not null, #座位类型
tickettype enum('8折票', '7折票', '儿童票', '优惠票') not null, #票类
ticketprice decimal(5, 2) unsigned not null, #票价
ticketnum varchar(20) unique not null, #票号
selldate date not null, #日期
selltime time not null, #时间
scene int unsigned not null, #场次
constraint pk_ticket primary key(moviehall, seatrow, seatcol, selldate, scene),
constraint fk_seller foreign key(sellerid) references seller(sellerid)
);在VS2008中有这么一段代码(控制台程序): std::string sentence = "insert into movieticket values ('一号厅', 7, 5, 1, '地震', '3D', '普通区', '优惠票', 50, '100729082', '2010-8-3', '15:18:0', 1)"; //表内并没有这条记录
//std::string sentence = "insert into seller(truename, username, password) values ('人人人', 'ab', '123')"; //此语句能正确执行 isSelect = false;
if(0 != mysql_real_query(mysql_, sentence.c_str(), sentence.length())) ------1
{
const char * str = mysql_error(mysql_);
return false;
}在句1处F10, 调试光标即消失不见,弹出控制台界面,下面的内容没有执行。就好像是被卡在了那一句一样。请问各位这个问题要怎么解决?
create table if not exists movieticket
(moviehall enum('一号厅', '二号厅', '三号厅', '五号厅') not null,
seatrow int unsigned not null,
seatcol int unsigned not null,
sellerid int unsigned not null, #售票员
moviename varchar(50) not null, #影片
movienameex enum('数字', '3D') not null, #影片扩展名
seattype enum('普通区') not null, #座位类型
tickettype enum('8折票', '7折票', '儿童票', '优惠票') not null, #票类
ticketprice decimal(5, 2) unsigned not null, #票价
ticketnum varchar(20) unique not null, #票号
selldate date not null, #日期
selltime time not null, #时间
scene int unsigned not null, #场次
constraint pk_ticket primary key(moviehall, seatrow, seatcol, selldate, scene),
constraint fk_seller foreign key(sellerid) references seller(sellerid)
);在VS2008中有这么一段代码(控制台程序): std::string sentence = "insert into movieticket values ('一号厅', 7, 5, 1, '地震', '3D', '普通区', '优惠票', 50, '100729082', '2010-8-3', '15:18:0', 1)"; //表内并没有这条记录
//std::string sentence = "insert into seller(truename, username, password) values ('人人人', 'ab', '123')"; //此语句能正确执行 isSelect = false;
if(0 != mysql_real_query(mysql_, sentence.c_str(), sentence.length())) ------1
{
const char * str = mysql_error(mysql_);
return false;
}在句1处F10, 调试光标即消失不见,弹出控制台界面,下面的内容没有执行。就好像是被卡在了那一句一样。请问各位这个问题要怎么解决?
解决方案 »
- 为什么Mysql的Qcache_free_memory还很大,但是Qcache_lowmem_prunes却不为0且一直在增加?
- 请问like后面如何用select语句?急!
- 求一条有关更新记录的mysql语句。
- Mysql主从复制出错,sql线程终止!
- 在数据表中提取随机的5条记录,怎么可以让随机的5条记录有可能是重复的呢?
- 请教一个MYSQL 修改字段内容的问题
- mysql-client是不是MYSQL的客户端工具?
- mysql ODBC 插入和更新不能正常关闭
- mysql Cluster 各个部分的作用是什么 在等大侠
- 关于docker下mysql问题
- myisam的key_buffer是如何工作的?
- 求mysql高手
insert into movieticket values ('一号厅', 7, 5, 1, '地震', '3D', '普通区', '优惠票', 50, '100729082', '2010-8-3', '15:18:0', 1)