For testing the TTFB for single pages loaded by a CMS I wan't to add new pages into my database without doing it one for one inside a CMS. For example I wan't to execute the query as below a 100 times inside a table, but how can I do this in mySql/phpmyadmin?
This query must be execute for 100 times
INSERT INTO `bolt_pages` (`id`, `slug`, `datecreated`, `datechanged`, `datepublish`, `datedepublish`, `username`, `ownerid`, `status`, `templatefields`, `title`, `image`, `teaser`, `body`, `template`) VALUES (NULL, 'hello-world', '2017-05-15 12:01:35', '2017-05-15 13:22:43', '2017-05-15 12:01:13', NULL, '', '1', 'published', '[]', 'Hello world', NULL, '<p>teaser</p>\r\n', '<p>Hello world</p>\r\n', '');
With a procedure should be...
DELIMITER $$
CREATE PROCEDURE simple_loop ( )
BEGIN
DECLARE counter BIGINT DEFAULT 0;
my_loop: LOOP
SET counter=counter+1;
IF counter=100 THEN
LEAVE my_loop;
END IF;
#SELECT counter; #uncomment if you'd like to print the counter
INSERT INTO `bolt_pages` (`id`, `slug`, `datecreated`, `datechanged`, `datepublish`, `datedepublish`, `username`, `ownerid`, `status`, `templatefields`, `title`, `image`, `teaser`, `body`, `template`) VALUES (NULL, 'hello-world', '2017-05-15 12:01:35', '2017-05-15 13:22:43', '2017-05-15 12:01:13', NULL, '', '1', 'published', '[]', 'Hello world', NULL, '<p>teaser</p>\r\n', '<p>Hello world</p>\r\n', '');
END LOOP my_loop;
END$$
DELIMITER
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With