First problem:
You're trying to
UNION
two sets with a different number of columns. You can only
UNION
sets with the same number of columns:
MySQL :: MySQL 5.7 Reference Manual :: 13.2.9.3 UNION Syntax[
^]
I suspect you want to
JOIN
the tables instead:
MySQL :: MySQL 5.7 Reference Manual :: 13.2.9.2 JOIN Syntax[
^]
Second problem:
You're specifying a three-part name for the tables -
cover.dbo.table
and
userdata.dbo.table
. That's MS SQL Server syntax, not MySQL syntax.
SELECT FirmName, UserShornName, UserPW FROM cover.table As firmlist JOIN userdata.table As admin ON admin.UserId = firmlist.FirmId
Third problem:
You appear to be storing passwords in plain text. Don't do that.
Secure Password Authentication Explained Simply[
^]
Salted Password Hashing - Doing it Right[
^]