Mysql – SQL Join Field and Content

join;MySQL

I have this MySQL Structure:

CREATE TABLE Fields (
ID INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
ForUser VARCHAR(255) NOT NULL,
ForCategory VARCHAR(100) NOT NULL,
FieldName VARCHAR(100) NOT NULL
);
CREATE TABLE Content (
ID INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
ForUser VARCHAR(255) NOT NULL,
ForCategory VARCHAR(100) NOT NULL,
ForField VARCHAR(100) NOT NULL,
FieldContent VARCHAR(255) NOT NULL
);

Now I want to make SQL Query that list results. Query must list content from 'Fileds' and must list content from 'Content' for specific Field. That will look like this:

FieldName > ID 1(Table:Fields)
-Content > ID 1(Table:Content)
-Content > ID 2(Table:Content)… FieldName > ID 2(Table:Fields)
-Content > ID 1(Table:Content)
-Content > ID 2(Table:Content)…

Best Answer

According with your last edit:

SELECT
    F.*,
    C.*
FROM db1.Fields AS F
JOIN db1.Content AS C ON (C.ID = F.ID AND C.ForUser = F.ForUser 
                          AND C.ForCategory = F.ForCategory)
WHERE `the field you want to filter`=`the value you want to search`;

You can filter with Any field in Fields or Content.