MySQL query, problem with my join? -


I'm not sure that there is a problem, but take a look:

I have 3 tables Are:

  • Category: ID, icon, name;
  • Subcategories: ID, Name, Description, Category_ID;
  • Subject: ID, Title, Text, Author, Created, Subcategory_ID;
  • I am now trying to get this information (query):

      $ string = "select categories.id catid, the categories. In caticon, categories. Catname as name, scatid as subcategories.id, subcategories.name AS scatname, scatdescription as subcategories.description, scatcatid as subcategories.category_id, as COUNT (topics.id) Topics, title AS ttitle, topics. Add sub-sub-categories to the above subclasses from categories classified as Tantric, Subject. ED = 1 sub-disciplines classes Honkaidi = themes. Subcategory_id GROUP BY categories.id ";  

    Result: <5 p>

    Perhaps the categories from 5% to 5 - OK, 4 show subcategories only in the first categories.

    Maybe even the question is long? Thanks for any answers.

    this

      subsection.category_id = 1  

    This should be

      Add sub-categories to sub-categories. Category_id = categories.id  

    Comments

    Popular posts from this blog

    c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

    Calling GetGUIThreadInfo from Outlook VBA -

    Obfuscating Python code? -