I checked the code, and you are running ALTER TABLE
everytime you're connecting to SQL.
This becomes a problem because you're now attempting to create a new primary key everytime (line #114), and there can be only 1 primary key.
You can run line #114 only once when the table is first created when it didn't exist.
If you run it multiple times you're going to have problems, this causes the error 'Multiple primary key defined
Just comment the line #114 if you have already created the table, or preferred way: move the primary and unique key into the CREATE TABLE
statement (line #112).
Then it'll only be executed once when the table doesn't exist.
CREATE TABLE IF NOT EXISTS `table22` (`param1` VARCHAR(32), `param2` VARCHAR(32), `clientpassword` VARCHAR(64), PRIMARY KEY (`param2`), UNIQUE KEY `uc` (`param1`) );
Now you can remove line 114.