DECLARE exit handler for sqlexception
BEGIN
-- ERROR
ROLLBACK;
END;
DECLARE exit handler for sqlwarning
BEGIN
-- WARNING
ROLLBACK;
END;
DELIMITER $$
CREATE PROCEDURE `transaction_sp` ()
LANGUAGE SQL
DETERMINISTIC
SQL SECURITY DEFINER
COMMENT 'Opa opa!))) '
BEGIN
DECLARE exit handler for sqlexception
BEGIN
-- ERROR
ROLLBACK;
END;
DECLARE exit handler for sqlwarning
BEGIN
-- WARNING
ROLLBACK;
END;
START TRANSACTION;
INSERT INTO table_name (id, name, address) values ('1','test!','toster.ru');
UPDATE second_table set name="Kolya" where id=4;
COMMIT;
END
$$
products.sort(function(a, b) {
if (a.category== selected_category && b.category != selected_category)
// здесь и определяется как будет все сортироваться
//например
// if ( (a.category== selected_category_1 || a.category== selected_category_2) && (b.category != selected_category_1 && b.category != selected_category_2))
// return -1;
// где selected_category_1 - барабаны а selected_category_2 гитары
return -1;
if (a.category != selected_category && b.category == selected_category)
return 1;
return 0;
});
history.pushState("", document.title, window.location.pathname);