You, beg for a SQL statement, I got a long time to get out of the wrong, the results are duplicates, trouble to help me see thank you ah.
Three tables, content, relationship, Meta,
Content is the contents, the primary key CID;
Meta Table Storage Classification of the corresponding name, type, etc., primary key mid;
Relationship is a relationship between content and Meta, two keys, CID and corresponding mid.
To get a SQL is to give a category name, say default, to find out the contents of the content and meta content into the array.
PS. A bit like WordPress inside the database structure, find a half-day did not find WP is how to achieve ... It's weak.
I tried to write a few, but all a bit wrong, join did not learn, trouble everyone help, thank you.
Reply content:
You, beg for a SQL statement, I got a long time to get out of the wrong, the results are duplicates, trouble to help me see thank you ah.
Three tables, content, relationship, Meta,
Content is the contents, the primary key CID;
Meta Table Storage Classification of the corresponding name, type, etc., primary key mid;
Relationship is a relationship between content and Meta, two keys, CID and corresponding mid.
To get a SQL is to give a category name, say default, to find out the contents of the content and meta content into the array.
PS. A bit like WordPress inside the database structure, find a half-day did not find WP is how to achieve ... It's weak.
I tried to write a few, but all a bit wrong, join did not learn, trouble everyone help, thank you.
It's done.
SELECT * from Hycms_metas as Mright JOIN hycms_relationships as r in M.mid = R.midjoin hycms_contents as C on r.cid = C.ci Dwhere m.slug = ' default ' and M.mid is not NULL