-- 删除原有表
DROP TABLE IF EXISTS `t`;
-- 创建数据表
CREATE TABLE IF NOT EXISTS `t` (
`s` varchar(255),
`e` varchar(255)
);
-- 创建存储
create procedure protest()
begin
declare s int;
declare t int;
declare e int;
set s=UNIX_TIMESTAMP('20140227050000');
set t=900;
set e=UNIX_TIMESTAMP('20140227230000');
while s<e do
set s=s+t;
insert into t(`s`,`e`) values(FROM_UNIXTIME(s),FROM_UNIXTIME(s+t));
set s=s+t;
end while;
end;
-- 调用存储
call protest();
-- 删除存储
drop procedure protest;
Using PHP
Insert the data into the sql table
Another MYSQL one
Do you want to generate such a table structure? Or is this table already existing? Do you want to insert table content like this