php如何实现对数据库表里面数据的批量修改??? php如何实现对数据库表里面数据的批量修改??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ?要批量修改的数据有什么共同点?SQL语句就可以了。 update table set 财富='穷鬼' where 职业='程序员' 用SQL语句,具体点,你想做啥? 简单的用 update 复杂点的用 存储过程 CREATE TABLE `products_sell_order_sub` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `i_main_id` bigint(20) unsigned NOT NULL DEFAULT '0', `i_cltid` int(11) NOT NULL DEFAULT '0', `c_pd_code` char(30) NOT NULL DEFAULT '-', `i_size_01` int(5) NOT NULL DEFAULT '0', `i_size_02` int(5) NOT NULL DEFAULT '0', `i_size_03` int(5) NOT NULL DEFAULT '0', `i_size_04` int(5) NOT NULL DEFAULT '0', `i_size_05` int(5) NOT NULL DEFAULT '0', `i_size_06` int(5) NOT NULL DEFAULT '0', `i_size_07` int(5) NOT NULL DEFAULT '0', `i_size_08` int(5) NOT NULL DEFAULT '0', `i_size_09` int(5) NOT NULL DEFAULT '0', `i_size_10` int(5) NOT NULL DEFAULT '0', `i_size_11` int(5) NOT NULL DEFAULT '0', `i_size_12` int(5) NOT NULL DEFAULT '0', `i_size_13` int(5) NOT NULL DEFAULT '0', `i_size_14` int(5) NOT NULL DEFAULT '0', `i_size_15` int(5) NOT NULL DEFAULT '0', `i_size_16` int(5) NOT NULL DEFAULT '0', `i_size_17` int(5) NOT NULL DEFAULT '0', `i_size_18` int(5) NOT NULL DEFAULT '0', `i_pairs` int(11) NOT NULL DEFAULT '0', `i_total` int(10) NOT NULL DEFAULT '0', `i_price` decimal(8,2) NOT NULL DEFAULT '0.00', `d_chk_date` date NOT NULL DEFAULT '2000-01-01', `d_sent_date` date NOT NULL DEFAULT '2000-01-01', #交货期 `c_extcode` char(25) NOT NULL DEFAULT '-',#客户货号 `c_logo` char(30) NOT NULL DEFAULT '-',#品牌 `c_to_address` char(10) NOT NULL DEFAULT '-', `c_info` char(200) NOT NULL DEFAULT '-', `i_kind` int(10) NOT NULL DEFAULT '0', #回单、计划、首次订单 `i_order_kind` int(3) unsigned NOT NULL default '0',#订单类别(内单、外单) 另表注明单据运算方法 `i_order_dept` int(3) unsigned NOT NULL default '0',#下单部门 `time` TIMESTAMP(14),#更新时间标记 `status` tinyint(3) unsigned NOT NULL default '0',#状态 PRIMARY KEY (`id`), KEY `idx_products_sell_order_sub_on_i_cltid` (`i_cltid`), KEY `idx_products_sell_order_sub_on_i_main_id` (`i_order_dept`,`i_main_id`), KEY `idx_products_sell_order_sub_on_c_pd_code` (`c_pd_code`), KEY `idx_products_sell_order_on_d_chk_date` (`d_chk_date`), KEY `idx_products_sell_order_on_d_sent_date` (`d_sent_date`), KEY `idx_products_sell_order_sub_on_i_order_kind` (`i_order_kind`), KEY `idx_products_sell_order_sub_on_i_order_dept` (`i_order_dept`), KEY `idx_products_sell_order_sub_on_time` (`time`), KEY `idx_products_sell_order_sub_on_status` (`status`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;这是表结构,可以根绝i_main_id相同的,经行修改。 常規SQL語句存儲過程 update就可以了。具体条件用where限定 php数组问题求助 数据入库后HTML标签就被剔除了,什么原因? 求一段php代码 关于yahoo mail API接口问题! (货单号)这种字段值怎么生成? AMFPHP 1.9显示错误 详细解释一下这些代码。 php连不上mysql,怎么办?多谢! 如何远程管理mysql??phpmyadmin怎样能实现???或是有其他软件?? 我怎么不能用 odbc 连接 Access 呢? 急急急 如何将多个 swf 文件 合并成一个 swf 文件 ioncube这个词表示什么意思?
SQL语句就可以了。
复杂点的用 存储过程
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`i_main_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`i_cltid` int(11) NOT NULL DEFAULT '0',
`c_pd_code` char(30) NOT NULL DEFAULT '-',
`i_size_01` int(5) NOT NULL DEFAULT '0',
`i_size_02` int(5) NOT NULL DEFAULT '0',
`i_size_03` int(5) NOT NULL DEFAULT '0',
`i_size_04` int(5) NOT NULL DEFAULT '0',
`i_size_05` int(5) NOT NULL DEFAULT '0',
`i_size_06` int(5) NOT NULL DEFAULT '0',
`i_size_07` int(5) NOT NULL DEFAULT '0',
`i_size_08` int(5) NOT NULL DEFAULT '0',
`i_size_09` int(5) NOT NULL DEFAULT '0',
`i_size_10` int(5) NOT NULL DEFAULT '0',
`i_size_11` int(5) NOT NULL DEFAULT '0',
`i_size_12` int(5) NOT NULL DEFAULT '0',
`i_size_13` int(5) NOT NULL DEFAULT '0',
`i_size_14` int(5) NOT NULL DEFAULT '0',
`i_size_15` int(5) NOT NULL DEFAULT '0',
`i_size_16` int(5) NOT NULL DEFAULT '0',
`i_size_17` int(5) NOT NULL DEFAULT '0',
`i_size_18` int(5) NOT NULL DEFAULT '0',
`i_pairs` int(11) NOT NULL DEFAULT '0',
`i_total` int(10) NOT NULL DEFAULT '0',
`i_price` decimal(8,2) NOT NULL DEFAULT '0.00',
`d_chk_date` date NOT NULL DEFAULT '2000-01-01',
`d_sent_date` date NOT NULL DEFAULT '2000-01-01', #交货期
`c_extcode` char(25) NOT NULL DEFAULT '-',#客户货号
`c_logo` char(30) NOT NULL DEFAULT '-',#品牌
`c_to_address` char(10) NOT NULL DEFAULT '-',
`c_info` char(200) NOT NULL DEFAULT '-',
`i_kind` int(10) NOT NULL DEFAULT '0', #回单、计划、首次订单
`i_order_kind` int(3) unsigned NOT NULL default '0',#订单类别(内单、外单) 另表注明单据运算方法
`i_order_dept` int(3) unsigned NOT NULL default '0',#下单部门
`time` TIMESTAMP(14),#更新时间标记
`status` tinyint(3) unsigned NOT NULL default '0',#状态
PRIMARY KEY (`id`),
KEY `idx_products_sell_order_sub_on_i_cltid` (`i_cltid`),
KEY `idx_products_sell_order_sub_on_i_main_id` (`i_order_dept`,`i_main_id`),
KEY `idx_products_sell_order_sub_on_c_pd_code` (`c_pd_code`),
KEY `idx_products_sell_order_on_d_chk_date` (`d_chk_date`),
KEY `idx_products_sell_order_on_d_sent_date` (`d_sent_date`),
KEY `idx_products_sell_order_sub_on_i_order_kind` (`i_order_kind`),
KEY `idx_products_sell_order_sub_on_i_order_dept` (`i_order_dept`),
KEY `idx_products_sell_order_sub_on_time` (`time`),
KEY `idx_products_sell_order_sub_on_status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
这是表结构,可以根绝i_main_id相同的,经行修改。
存儲過程
具体条件用where限定