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.

Is there any relation exist in the database for relational field ?

October 01, 2007 8:00am

Subscribe [1]
  • #1 / Oct 01, 2007 8:00am

    sougat

    2 posts

    I have found a strange situation in the weblog_data table.

    In my site there is a custom field(relational type) which holds relationship between two weblogs.

    In the drop down where that field exists shows values as the “entry_id” of the weblog and level as the “title” of the weblog.

    But while entering the data against the corresponding field in the table “exp_weblog_data” table, it always stores different values for the same “title” ie “label”. More so, the values are always incremented when I save the data of the particular weblog.

    Is there any other table which stores the values for the relational field? if so what is the relation between the exp_weblog_data and exp_weblog_title ?

  • #2 / Oct 01, 2007 8:48am

    Daniel Walton

    553 posts

    Hi Sougat,

    Try and think of the exp_weblog_titles and exp_weblog_data table being a single table. An ‘entry’ is only split across both for performance reasons. The table which holds relationships is exp_relationships. The incremental value you are seeing is the rel_id value from that table.

  • #3 / Oct 01, 2007 11:50am

    sougat

    2 posts

    Hi,,
    Thanks for your reply.
    It helps me a lot…

    Can you plz tell me whether we can use nested query module..I mean to say can we do
    like,

    {exp:query sql="select….."}

    ENTRY ID=={entry_id}<br>

      {exp:query sql="select * from exp_weblog_data where entry_id = '{entry_id}’”}

      Field ID={field_id_34}<br>

      {/exp:query}

    {/exp:query}

    I was trying this..Though the “entry_id” are listed properly…the inner queries does not work properly..

    It always gives the same out put, though those should have been different.

    ENTRY ID==109
    Field ID=31
    ENTRY ID==111
    Field ID=31
    ENTRY ID==112
    Field ID=31


    Is there any solution?

  • #4 / Oct 01, 2007 12:05pm

    Daniel Walton

    553 posts

    Can you simplify your problem? I understand your question, but I do not understand why you want to nest queries… there is almost always an easier solution 😊

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

ExpressionEngine News!

#eecms, #events, #releases