2 Replies Latest reply on Oct 2, 2008 8:30 AM by mrcharis2003@yahoo.c

    Displaying correct data from passed variable...recordset nightmare....PLEASE HELP

    mrcharis2003@yahoo.c Level 1
      Hi there

      I am trying to display data from a passed variable and I am having no luck... I have actually been trying for months.....

      I will explain.....

      (First... I can understand the process of passing variables a little.....I can display user data by passing a kt_login variable from user list to detail page....)

      Background..... I am building an art gallery site..... a site which displays pictures from many different artists.....

      So far.......
      I have set up the back end completely working..... using dynamic lists and forms.....

      i have all my data stored in two tables...... paintings and artist these tables are joined (using QUB)

      I store all the painting info in the painting table and the artist in the other and link the two tables ...... works fine...

      I have two forms add painting and add artist..

      In my upload painting form I have all the fields I need and a dropdown menu to choose the artist ....(dynamically populated from the artist table...love the way that works.... so that when i add an artist with the add artist form it automatically appears in the drop down menu of the add painting form).... anyway the form works

      The add artist form works too

      Then I have 2 dynamic list pages ... Admin list painting and admin list artist...... all working perfectly...... all the delete, update and most importantly the filter by artist name in the list painting works fine....

      So good so far.....

      i then create a new page "artists" that displays thumbnails of all the artists I have added .... using horizontal looper etc...... this page also works fine....

      But..... NOW I WANT TO LINK THE THUMBS TO A DETAIL PAGE THAT I WANT TO ONLY DISPLAYS PICS FROM THAT ARTIST

      So I create a "artist gallery" page

      I then go back to the "artists" page and create a link from the thumbnail the the "artist gallery page" passing the url variable id_artist

      I previewed the artist page in browser and clicked on a thumb of an artist and checked in the browser address window and i find that it is passing the correct variable .... the address is as follows http://localhost/mysitename/artistgallery.php?artist=14 14 being the correct id of the artist So the thumb is passing the correct variable to the detail 'artist gallery' page

      So now I have real problems......

      So I go to the artist gallery page and insert a recordset...... but how do I display records from the passed url variable from the 'artists' page ?

      First I insert a recordset that retrieves data from the painting table and filters by name_painter and = url parameter id_artist and it doesn't work

      i have had this working in the past by entering an id value into the recordset window...... filter by name_painter.... url parameter = equalto entered value 14 (the id of one of the painters) but I need it to all work dynamically... i cant enter the idfferent id of each painter into every record gallery page....)
      Now I am lost I have tried soooo many different ways to make this work

      So...... any ideas how to display the correct records?

      I am passing the url parameter id_artist to the detail page
      'artist gallery' So if I am passsing a variable which is say 14 as in the display //localhost/mysitename/artistgallery.php?artist=14 How do i display records that are only from the artist id 14?

      Any help would be great

      have a nice day
        • 1. Re: Displaying correct data from passed variable...recordset nightmare....PLEASE HELP
          Günter Schenk Level 4
          Hi charis,

          -------
          First I insert a recordset that retrieves data from the painting table and filters by name_painter and = url parameter id_artist and it doesn't work
          -------

          does the "name_painter" column actually hold the "id_artist" value or is it some other data ? However, a link to the "artistdetails.php" page code (as .txt file) would be helpful to see how it´s currently done.

          --------
          So if I am passsing a variable which is say 14 as in the display //localhost/mysitename/artistgallery.php?artist=14
          --------

          the variable name is "artist", but you say you´re filtering against a variable named "id_artist" -- this will need to be identical, or is that just a typo error ?

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Displaying correct data from passed variable...recordset nightmare....PLEASE HELP
            mrcharis2003@yahoo.c Level 1
            Hi there

            Thanks for your reply I have been trying alllll day to get this to work......still no luck......you got me going in the write direction though thanks
            testjoin.php
            When you said .....
            the variable name is "artist", but you say you´re filtering against a variable named "id_artist" -- this will need to be identical, or is that just a typo error ?

            That was not a type error I just did not know that the name and value field have to be the same...... I still not sure why....

            So I tried maaaany diffferent ways using name id_artist value id_artist using maaaany different combinations of recordsets and still no luck ... really I spent about five hours trying to get just this to work......

            i will start at the beggining .... again

            I not sure what you mean when you say "a link to the "artistdetails.php" page code (as .txt file)' ...... if you could explain I would be happy to

            I started all over on my gallery site this morning... to streamline and simplify all the tables I use to make it easier to explain my problem here....

            I have to say that the longer I use addt the better I get .... it is amazing software...... really I was able to get nearly the complete back end of the site done in less than two hours..... something that would have taken me weeeeeks a few months ago......

            Anyway here is what I have.......

            I have only two tables now..... paintings and artists

            The paintings table painting_info

            id_painting INT 200 primary key
            name_painting varchar 200
            artist_painting INT 200
            datadded_painting datetime 00000000000blablabla

            The artists table artist_info

            id_artist INT 200 primary key
            name_artist varchar 200
            datadded_artist datetime 00000000000blablabla

            i then created all these pages to insert edit and display all the info I need

            in order of creation
            addartist.php
            adminartistlist.php
            editartist.php

            then
            addpainting.php
            adminpaintinglist.php
            editpainting.php

            I used dynamic lists and forms to get all these pages working....
            all these pages work great.....

            I wanted to be able to choose an artist name from a drop down menu in the addpaing.php page... that is dynamically populated from databadse so that took me about another 2 hours to figure out.... but works really well in the end..... I can now add a new artist and that name appears dynamically in the add painting form... dropdown menu.... really cool

            So I inserted about 10 artist names into the artist table and about 20 paintings into the painting table

            I then conected the two tables using QUB ..... then tested the connection using a simple dynamic table..... on a seperate page

            testjoin.php

            the dynamic table showed that the two tables were joined correctly
            with the artist_painting fields matching the id_artist fields
            the sql is

            SELECT painting_info.*, artist_info.*
            FROM (painting_info
            LEFT JOIN artist_info ON artist_info.id_artist=painting_info.artist_painting)

            So then I made two more pages....

            artists.php to display all the artists and
            artistgallery.php to display each artists paintings

            So first for the artists.php page I.......

            inserted a simple recordset that retrieves data from the artist_info table

            I used a show thumbnail behavior and looped it....

            and tested in browser... all works fine shows all the artists

            then I go back and create a link from the looped thumbnail to the artistgallery.php page and set the parameters to pass to name artist_id
            value artist-id

            I then test in browser and the link works it opens the artistgallery.php page

            in the browser address window is example.....
            http://localhost/gallery/pages/artistgallery.php?12=12

            12 being the arist id id_artist

            So far so good.......

            Then I open the artistgallery.php page and try to make it display the correct pictures associated with the artist... the artist that I passed the variable from the artists.php page....

            and i have tried every imaginable combination of recordset I have made the page and remade the page 100 times today still with no luck....

            first I inserted a simple recordset that only retrived data from the painting_info table..... and filter by artist_painting field url = artist_painting.... and it does not work......

            i fugure that it should work because the artist_painting field is linked to the id_artist field..... but it does not...

            So i try to use maaaannny different cambinations of record sets on both the artist page and the artist gallery page
            all different types of passed variables

            I have tried absolutely everything i could possibly think of .... and more..... and nothing works

            i asked similar questions a couple of months ago when I needed to do the same thing and I got around it by using a simple recordset filtered by product_category entered value = ___ (then I would put the id of the product) and it would display only the products in that category ok .... grreat ... nut not dynamic.....

            Now I want to add a new artist.... have that artists name appear automatically in a dropdown menu in the add artist page (this I can do) then display that artists info and picture on a list artist page (this I can do to)...... but then i want to be able to click a picture of an artist and be taken to "their" gallery page...... this I cant do

            Sorry to post suuuuch a long message I just reallly want to get this working I really need this in all the sites I am working on ....

            Any help would really make my day.... my week....

            I am really lost I have no idea what to do next...

            If you need any more info I would be only to happy...... ...

            I been trying to help some other people who post on this forum.....

            anyway have a great day thanks again ....