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
Related Tags
php × 626mysql × 519
phpmyadmin × 54
database-design × 48
sql-server × 25
performance × 25
mysqli × 25
postgresql × 21
join × 16
mysql-5.5 × 15
optimization × 14
mongodb × 13
innodb × 13
mariadb × 13
query-performance × 12
mysql-5.6 × 11
select × 7
linux × 7
insert × 7
array × 7
replication × 6
permissions × 6
foreign-key × 6
myisam × 6
count × 6