ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

category group with an sql query is this possible

June 22, 2007 4:55am

Subscribe [2]
  • #1 / Jun 22, 2007 4:55am

    ummedia

    466 posts

    Hi I have some code that I have been using from the forum, ive mixed together the create a table with the categories and amount sql. Its great it all works 4 folders across and as many down as needed. I have many categories but these are spilt into groups I wondered if I could use the {category_group} =2 somehow in the script below I’ve tried a couple of ways but it wasnt happy any help greatly appreciated many thanks adam

    <br /> <table><tr><br /> {exp:query sql="SELECT count( exp_category_posts.entry_id ) AS count_1,<br /> exp_category_posts.cat_id, exp_categories.cat_name<br /> FROM exp_categories, exp_category_posts<br /> WHERE exp_category_posts.cat_id = exp_categories.cat_id<br /> GROUP BY exp_categories.cat_name"}<br /> <td width=169 height=93 valign=top><a href="http://{path=intelart/category}C{cat_id}/">http://www.ummedia.com/MY_SITES/fatlava/Resources/suitcase.gif</a><br /> {cat_name} ({count_1})</td><br /> {if {count} == “4”}</tr><tr>{/if}<br /> {if {count} == “8”}</tr><tr>{/if}<br /> {if {count} == “12”}</tr><tr>{/if}<br /> {if {count} == “16”}</tr><tr>{/if} <br /> {if {count} == “20”}</tr><tr>{/if}<br /> {if {count} == “24”}</tr><tr>{/if}<br /> {if {count} == “28”}</tr><tr>{/if}<br /> {if {count} == “32”}</tr><tr>{/if} <br /> {/exp:query}<br /> </tr></table> <br />

  • #2 / Jun 22, 2007 10:47pm

    ummedia

    466 posts

    it takes so long to get answers here, could there not be a beginners forum that ellis lab patrol. There must be so many people that come in with EE core and leave because they dont get answers to their questions quickly enough.
    With EE there’s huge new user base out there waiting to be tapped(freelance designers/graphic designers) that finally get the chance to put together a CMS site for their clients.
    I am a designer who has found EE fantastic and when you do get answered people are so friendly, but sometimes I have to wait for days for an answer, as a beginner this isnt going to keep you here and profit lost!

    sorry for the rant but I like EE so much, and I can see this huge gaping flaw that will stop its user base growing.

    oh and I want my simple question answered….please

    Adam

  • #3 / Jun 22, 2007 11:02pm

    Lisa Wess

    20502 posts

    Hi, Adam!

    I am sorry that you have not received more prompt responses to your questions.  I would like to take a moment to point that even if there were a “new users forum” as you suggest, the question you asked here wouldn’t go there - SQL queries are not for “new users” - for instance, while the rest of the team is quite capable with said queries, I personally am not - and I am not a new user.  As you can see, it can be quite hard to decipher those kinds of issues.

    Furthermore, even a new users forum, if handled by EllisLab, would be for licensed verions only - that would not assist the Core users as you describe it.

    Lastly, I would just like to point out that this week has been unusually busy for us with the release of 1.6.  We come in here as often as we can to help, but our priorities are assisting in the Technical Support forums - and with any major release (and even some minor ones) we are pushed to handle those - all of our time has been taking with making sure 1.6 and the upgrade process is a good experience for all.

    Anyway - for your question, if you would like to add a plain english explanation of your goal, and even perhaps a diagram of the output you envisage, then people would be more able to help as they would understand the question more.  I am not quite certain what you were asking or even if a SQL query is needed in this case.

    We thank you for your patience and understanding - we are always looking for ways to improve the customer experience, and your recommendations and observations have definitely been noted.

  • #4 / Jun 22, 2007 11:43pm

    ummedia

    466 posts

    Lisa
    Lisa I really am a beginner and certainly not a coder I have only started EE a month ago. I copied the sql and the table code from the forums.

    The page is at

    http://www.ummedia.com/MY_SITES/fatlava/EE/index.php/intelart/categories/

    before you say anything I have a personal license and will get a commercial licence if I use this model. I am just playing around with a client site to see what EE can do.

    I have and am trying to do.

    Get used categories and their count from the weblog with the sql query.(code from forum)
    Input them using a template entry table(code from forum)(note the one on the forum breaks when used with the sql code because the count variable is overridden by the sql).

    trying to add

    some code to make all the code above only spew out a specific category group so I could then use headings etc.


    thank you for your help

    Adam

  • #5 / Jun 23, 2007 1:03am

    Ingmar

    29245 posts

    it takes so long to get answers here

    Not as a rule, it doesn’t.

    There must be so many people that come in with EE core and leave because they dont get answers to their questions quickly enough.

    I seriously doubt that very much.

    oh and I want my simple question answered.

    So there was a question? Cause I didn’t see it when I read your post for the first time; and still don’t quite understand what you want or need.

  • #6 / Jun 23, 2007 3:31am

    ummedia

    466 posts

    Ingmar,
    I am not going to get into a debate, I really like EE and I like the forum, I just wanted to point out to ellislab that maybe should put some more emphasis on beginners from other fields that may find EE really useful to their business and of course to ellislabs, but find the initial journey very daunting.

    It is as always with questions from beginners, poorly put, but wheen you dont really understand your new coding environment it makes it very difficult to make the question.
    I thought I did better in my second response to Lisa, but I will try again.

    I would like to retrieve from my weblog all the categories along with their count number, when the categories are returned they are fused into some html and outputted every count of four, 8, 12,16 a <tr></tr> is added.
    These categories belong to category groups I would like to add this abiltily into my code but dont know where to put it. {category_group = "1"}(just show me the results from this category)
    The code is in the first message, it hasnt changed as It does everything I want except show the category group I want.


    regards

    Adam

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases