www.webdeveloper.com
Results 1 to 2 of 2

Thread: MySQL add extra peel

  1. #1
    Join Date
    Dec 2010
    Posts
    6

    MySQL add extra peel

    Hi,

    My joomla website has a table: jos_rsform_submission_values.
    This table has the following columns: SubmissionValueId, FormId, SubmissionId, FieldName and FieldValue.

    The Fieldname column contains: Region, Name, Adress, Telephone and Email.

    I managed to create a query that puts some data in a nice line. (See below)
    The "problem" is, it shows all the form submissions.

    I would love to have this query a bit adapted. I would like to have shown only the data that belongs to a certain region. So, in the form region 111 is submitted. Can i adapt or expand the query below, so that it only shows the Name, Adress,Email and telephone from region 111 ?

    Can someone help me on this, or at least point me into the right direction ?
    Thanks in advance !

    ==========================================================

    SELECT A.FormId, B.SubmissionId, B.DateSubmitted, B.UserIp,
    (SELECT FieldValue FROM jos_RSFORM_SUBMISSION_VALUES AS X WHERE
    (X.FieldName = 'Name') AND (X.SubmissionId=B.SubmissionId)) as
    Naam ,
    (SELECT FieldValue FROM jos_RSFORM_SUBMISSION_VALUES AS X WHERE
    (X.FieldName = 'adress') AND (X.SubmissionId=B.SubmissionId)) as
    Adress ,
    (SELECT FieldValue FROM jos_RSFORM_SUBMISSION_VALUES AS X WHERE
    (X.FieldName = 'telephone') AND (X.SubmissionId=B.SubmissionId)) as
    Telephone ,
    (SELECT FieldValue FROM jos_RSFORM_SUBMISSION_VALUES AS X WHERE
    (X.FieldName = 'email') AND (X.SubmissionId=B.SubmissionId)) as Email,


    FROM jos_RSFORM_FORMS A,
    jos_RSFORM_SUBMISSIONS B
    WHERE A.FormId=B.FormId
    AND A.FormId = 2

    ==========================================================

    Mesjoggah !

  2. #2
    Join Date
    Dec 2010
    Posts
    6
    Have been able to fix it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles