Hot answers tagged

1

CREATE PROCEDURE has no IF NOT EXISTS. You have to drop it and create it a new Also php and mysqli don't add DELIMITER to the CREATe PROCEDURE, so you have to do it yourself. So the code must loook like DROP PROCEDURE IF EXISTS Insertion; DELIMITER $$ CREATE PROCEDURE Insertion(IN firstname varchar(40),IN lastname varchar(40),IN email varchar(40),IN ...


1

A sketch for an alternative approach would be: -- supertype for user / group, it is not clear from your post what -- an appropriate name would be, so I'll just use `x`. each x is of a -- certain type. CREATE TABLE x_types ( x_type CHAR(1) NOT NULL PRIMARY KEY , -- maybe add a description ); INSERT INTO x_types (x_type) VALUES ('u'), ('g'); CREATE ...


Only top voted, non community-wiki answers of a minimum length are eligible