mysql_query中如何同时执行多条sql语句?

caolonglong 2003-06-20 07:55:15
谢谢
...全文
1012 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuzuning 2003-08-19
  • 打赏
  • 举报
回复
INSERT INTO tbl_name VALUES (第一组值),(第二组值),(第三组值),(...);

INSERT INTO tbl_name VALUES (第一组值);
INSERT INTO tbl_name VALUES (第二组值);
INSERT INTO tbl_name VALUES (第三组值);
INSERT INTO tbl_name VALUES (...);
mrsun 2003-08-19
  • 打赏
  • 举报
回复
用;就应该可以啊
我经常用
myblessu 2003-06-25
  • 打赏
  • 举报
回复
可以用批量插入,如:

INSERT INTO hy_art_index VALUES (第一组值),(第二组值),(第三组值),(...);
mrsun 2003-06-25
  • 打赏
  • 举报
回复
每句用;连接
ipman 2003-06-21
  • 打赏
  • 举报
回复
想在web中玩多线程?解释型的脚本不可能实现,如果要求精度不够高的话可以考虑同时开多个窗口运行sql
bonniewater 2003-06-21
  • 打赏
  • 举报
回复
up
xizi2002 2003-06-21
  • 打赏
  • 举报
回复
up一下,好像不行,不过下面的insert你可以生成一条执行,具体你可以看insert语法
caolonglong 2003-06-21
  • 打赏
  • 举报
回复
CREATE TABLE hy_art_index (
id int(10) unsigned NOT NULL auto_increment,
fid int(10) unsigned DEFAULT '0' NOT NULL,
title varchar(255) NOT NULL,
userid int(10) unsigned DEFAULT '0' NOT NULL,
username varchar(30) NOT NULL,
post_time int(10) unsigned DEFAULT '0' NOT NULL,
reply_userid int(10) unsigned DEFAULT '0',
reply_username varchar(30) DEFAULT 'NULL',
reply_time int(10) unsigned DEFAULT '0' NOT NULL,
reply_count int(10) unsigned DEFAULT '0',
read_count int(10) unsigned DEFAULT '0',
is_upload_file enum('0','1') DEFAULT '0' NOT NULL,
is_upload_pic enum('0','1') DEFAULT '0' NOT NULL,
master_score int(10) unsigned DEFAULT '0',
user_score int(10) unsigned DEFAULT '0',
is_top enum('0','1') DEFAULT '0' NOT NULL,
is_auth enum('0','1') DEFAULT '1' NOT NULL,
edit_userid int(3) unsigned DEFAULT '0' NOT NULL,
is_close enum('0','1') DEFAULT '0' NOT NULL,
is_elite enum('0','1') DEFAULT '0' NOT NULL,
elite_time int(10) unsigned DEFAULT '0',
is_del enum('0','1','2') DEFAULT '0' NOT NULL,
is_recycled enum('0','1') DEFAULT '0' NOT NULL,
recycled_time int(10) unsigned DEFAULT '0',
edit_username varchar(50),
edit_time int(10) unsigned DEFAULT '0' NOT NULL,
KEY id (id),
KEY reply_time (reply_time)
);
INSERT INTO hy_art_index VALUES ( '1', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '2', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '3', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '4', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '5', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '6', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '7', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '8', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '9', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '10', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '11', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '12', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '13', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '14', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '15', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '16', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '17', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '18', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '19', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
INSERT INTO hy_art_index VALUES ( '20', '1', '', '1', '', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', NULL, '0');
caolonglong 2003-06-21
  • 打赏
  • 举报
回复
INSERT INTO HyForum_forum VALUES ( '21', '20', '1', '0', '0', '', '0', 'aa', '', '', '0', '', '', 'Sunset.jpg', '0', '2', '300', 'bmp,jpg,gif,png,doc,zip', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');
INSERT INTO HyForum_forum VALUES ( '23', '0', '2', '0', '0', '', '0', 'aa', '', '', '0', '', '', '', '0', '2', '300', 'bmp,jpg,gif,png,doc,zip', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');
INSERT INTO HyForum_forum VALUES ( '24', '0', '3', '0', '0', '', '0', 'aa', '', '', '0', '', '', '', '0', '2', '300', 'bmp,jpg,gif,png,doc,zip', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');
INSERT INTO HyForum_forum VALUES ( '25', '32', '1', '20', '20,21', '', '0', 'aa', '', '', '0', '', '', '', '0', '2', '300', 'bmp,jpg,gif,png,doc,zip', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');
INSERT INTO HyForum_forum VALUES ( '26', '0', '4', '0', '0', '', '0', 'aa', '', '', '0', '', '', '', '0', '2', '300', 'bmp,jpg,gif,png,doc,zip', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');
INSERT INTO HyForum_forum VALUES ( '27', '0', '5', '0', '0', '', '0', 'aa', '', '', '0', '', '', '', '0', '2', '300', 'bmp,jpg,gif,png,doc,zip', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');
INSERT INTO HyForum_forum VALUES ( '28', '1', '6', '0', '0', '', '1', 'bb', '', '', '0', '', '', '', '0', '2', '300', 'bmp,jpg,gif,png,doc,zip', '1', '1', '0', '0', '0', '0', '0', '', '5', '0', '2', '0', '1', '0', '0', '2', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');
INSERT INTO HyForum_forum VALUES ( '29', '30', '7', '0', '0', '', '0', 'cc', '', '', '0', '', '', '', '0', '2', '300', 'bmp,jpg,gif,png,doc,zip', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '0', '1', '1');
INSERT INTO HyForum_forum VALUES ( '30', '0', '1', '29', '29', '', '0', 'ccc', '', '', '0', '', '', '', '0', '2', '300', 'bmp,jpg,gif,png,doc,zip', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');
INSERT INTO HyForum_forum VALUES ( '31', '0', '9', '0', '0', '', '0', 'asdfasdf', '', '', '0', '', '', '', '0', '2', '300', 'upload_file_exts', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');
INSERT INTO HyForum_forum VALUES ( '32', '0', '1', '25', '25,20,21', '', '0', 'bb', 'sdfasdfasdfa
asd
fas
dfa
sdf', '', '0', '', '', '', '0', '2', '300', 'upload_file_exts', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');
INSERT INTO HyForum_forum VALUES ( '33', '0', '10', '0', '0', '', '0', '测试版块', '测试一下,看看如何?', '', '0', '', '', 'Sunset.jpg', '0', '2', '300', 'upload_file_exts', '1', '1', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1');

caolonglong 2003-06-21
  • 打赏
  • 举报
回复
这是我得sql语句:
CREATE TABLE HyForum_forum (
id int(10) unsigned NOT NULL auto_increment,
sid varchar(255) DEFAULT '0' NOT NULL,
taxis tinyint(3) unsigned DEFAULT '0' NOT NULL,
parent_id int(10) unsigned DEFAULT '0' NOT NULL,
seniority_id varchar(255) DEFAULT '0' NOT NULL,
master varchar(255),
type enum('0','1') DEFAULT '0' NOT NULL,
name varchar(255) NOT NULL,
intro text,
icon varchar(255),
only_show_icon enum('0','1') DEFAULT '0',
deck_left varchar(255),
deck_right varchar(255),
picture varchar(255),
upload_file enum('0','1','sys') DEFAULT 'sys' NOT NULL,
upload_file_num tinyint(3) unsigned DEFAULT '1',
upload_file_size int(10) unsigned DEFAULT '0',
upload_file_exts varchar(255),
upload_file_picwidth smallint(5) unsigned DEFAULT '0',
upload_file_onlymaster enum('0','1') DEFAULT '0',
only_user_browse enum('0','1') DEFAULT '0' NOT NULL,
hidden enum('0','1') DEFAULT '0' NOT NULL,
attrib enum('0','1','2','3','4','5') DEFAULT '0' NOT NULL,
inte enum('0','1') DEFAULT '0' NOT NULL,
inte_hy enum('0','1') DEFAULT '0',
inte_url varchar(255),
count_real_title int(10) unsigned DEFAULT '0',
count_real_reply int(10) unsigned DEFAULT '0',
count_title int(10) unsigned DEFAULT '0',
count_reply int(10) unsigned DEFAULT '0',
count_recycle_title int(10) unsigned DEFAULT '0',
count_recycle_reply int(10) unsigned DEFAULT '0',
count_elite_title int(10) unsigned DEFAULT '0',
count_noauth_title int(10) unsigned DEFAULT '0',
count_noauth_reply int(10) unsigned DEFAULT '0',
count_close_title int(10) unsigned DEFAULT '0',
show_son enum('0','1') DEFAULT '1',
inherit_master enum('0','1') DEFAULT '1' NOT NULL,
disinherit_master_fid int(10) unsigned DEFAULT '0' NOT NULL,
inherit_allowuser enum('0','1') DEFAULT '1' NOT NULL,
disinherit_allowuser_fid int(10) unsigned DEFAULT '0' NOT NULL,
super enum('0','1') DEFAULT '1',
setpic enum('0','1') DEFAULT '1',
setuploadfile enum('0','1') DEFAULT '1',
setassistant enum('0','1') DEFAULT '1',
setallowuser enum('0','1') DEFAULT '1',
PRIMARY KEY (id),
KEY taxis (taxis)
);

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧