Gossamer Forum
Home : Products : DBMan : Customization :

Relational Mod Demo

Quote Reply
Relational Mod Demo
I have been attempting to install and run JPDeni's Relational Mod Demo
http://www.jpdeni.com/cgi-bin/relation/db.cgi?db=user
and have not been very successful.

Carol indicates that the files used in the demo are the same files available in the download zip link, however, after installing, the scripts are not performing the same.

A comparison can be made by visiting:
JPD's http://www.jpdeni.com/cgi-bin/relation/db.cgi?db=user
Downloaded scripts
http://today.az1net.com/cgi-bin/relational/db.cgi?db=user

and selecting the link in this line 'If you would just like to see the database in action, you can go here.'

Then, select List All Items and following thru by selecting any one of the resulting product links displayed ('Owen' appears in both JPD's demo and the downloaded files)
It can be seen, when the product record is displayed, the
Offered by:
& From: field results are displayed in JPD's example whereas these two fields do not display a result when running the scripts from the download.

With debugging activated, there are no errors reported in the scripts however, my server error logs are indicating:

Operator or semicolon missing before &switch_to_user at ./item_html.pl line 166.
Ambiguous use of & resolved as operator & at ./item_html.pl line 166.



my (%rec) = @_; # Load any defaults to put in the VALUE field.
$rec{'UserID'} =~ s/<\/?B>//g;
&switch_to_user;
%rec2 = &get_record($rec{'UserID'}); <<< this is line 166 in item_html.pl
&switch_to_item;

I have uploaded text copies of the files at http://today.az1net.com/relational/
and would appreciate feedback and instruction on correcting the problem. - - - Quite honestly, I have gone cross-eyed looking, trying, replacing, researching and failing! <grin> Thanks!

Karen

PS - I've installed and been trying to identify the problem in the files in order to help other DBMan users.

Quote Reply
Re: Relational Mod Demo In reply to
Thanks for doing this Karen :)

I'm surprised no one has had this problem before me as the demo has been available for quite a while hasn't it.

Should I send JPDeni an email regarding the problem?

I just hope someone here can solve the problem because it's vital to my database.

Have anyone here got a relational database working (between 2 databases) that I could use as a guide? I'd need all the files from the database. I would however prefer if someone could find a solution to the problem Karen stated above.

-----

5 minutes later

Just send JPDeni an email. Hopefully I get a response...

Quote Reply
Re: Relational Mod Demo In reply to
Just got a reply from JPDeni,

I just can't deal with DBMan on a personal basis any more. If there are
major problems with the relational database mod, then I think my best bet
would be to remove it from my site and from the list of mods at Gossamer
Threads.

I'm sorry you're having problems.

JPDeni

Quote Reply
Re: Relational Mod Demo In reply to
Philip:

Several people are using the relational mod succesfully and there are numerous step-by-step posts on setting up the two databases.

From your previous posts I am not sure you are getting the individual databases working before trying to make the run as a relational database. And having several posts regarding this I'm not sure anymore what you problem was to begin with.. it confusing when you keep jumping to new posts.

You may want to check out the FAQ noted below and look under "multi & relational". I have JPDeni's notes and also notes I took which explain exactly what changes need to be made in your files. There is also several examples provided. You may have to take the time going through these threads to gain an understanding of what you need to do and how it all works.

Karen:

I have not heard of any problems running the demo, but will set it up on a server later tonight and see if I have any problems running it. First I have to locate a default db.cgi file as I have heavily modified versions, but not sure I have an original.



Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Relational Mod Demo In reply to
Thanks for the detailed message LoisC.

JPDeni replied to another one of my messages saying this:

Okay. I just downloaded the directory which has all the files currently on my site, zipped the whole directory and then uploaded the .zip file. You can pick it up at

http://www.jpdeni.com/relation.zip

JPD

so hopefully I can now get it to work. I'm off to try now.

-----------
5 minutes later

IT WORKS NOW!!!!!!!!!!!!!! I'M SO HAPPY!!!!!!!!!!!!!!!! AT LAST I HAVE SOMETHING TO GO BY!!!!!!!!! :) :) :) :) :)


Quote Reply
Re: Relational Mod Demo In reply to
For those interested in starting off with this sample set-up of Relational Mod - JPDeni's zip files will give a good jump start. I was not able to get the "sample" products to display with the "sample" users (same as indicated in first post) however, when adding my own userid and sample products, they displayed properly.

LoisC - thanks for the feedback - Presently, calling the items db directly from the address line results in a 500 server config error - Is there someway to isolate the cause of this error and have the display provide a means of getting to the user side for creating a user login or accessing the items?

The same error occurs on JPDeni's installation.
http://www.jpdeni.com/cgi-bin/relation/db.cgi?db=item

Thanks!

Quote Reply
Re: Relational Mod Demo In reply to
Karen:

I'll check it out as soon as I'm able to.

I know you haven't, but please don't encourage people to email JPDeni for solutions as she is dealing with major health issues at this time.

It may take me a few days to see if I have any problems with this. But by adding the "Useful error messages" snippet, it is usually very easy to find problems within the script.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
I got it to work but.......I don't understand.... In reply to
I could not get the alterations to work from her detailed notes. After a forum search I found a link to her demo site. I downloaded her .zip file and all worked well after adding a few lines to db.cgi and altering the .cfg files to point to my dbman directory. Then I tried to alter the files to suite my own use. Here is what happened.
First I copied the html_record_long output file to the format of html_record section. It worked, but the offered by and from fields were not filled in. I went and copied:
In Reply To:
$rec{'UserID'} =~ s/<\/?B>//g;
&switch_to_user;
%rec2 = &get_record($rec{'UserID'});
&switch_to_item;
into the top of html_record. Now when a user hits list all items a detailed output was created. At this point the database worked perfectly in all areas.

I redefined the db def by using the confiurator on Jpdeni's site. I copied over the definition and the select fields that I needed. The rest of the script was left untouched. The userid and itemid were not altered in any way by my fields alterations.
I then went into item_html and altered the html_record_form, html_record, and html_record_long. I used the exact same format as was stock in the download. I only changed the field names I was using and how they were displayed.

Then I started to test my new implementation. All of a sudden the list all items was dropping data. It was also linning up data incorrectly. Somehow I made the script associate the data with the wrong slot in the db. In the first record of the list all was correct. In the susequent records the data started to slide down the record. The userid slid down to itemid and all the rest followed suite. Are there more changes I need to make than just the %db_def, %db_select_fields, %db_radio_fields, %db_checkbox_fields, and the above mentioned item_html sub sections? I did get my database to work perfectly in the end, but only because I kept all of jpdenis orriginal field names (price is now equal to boaspecies in my use). But I would like to know for future expansion how to go about adding or deleting fields.
To see my implementation go to http://www.tinygiants.com/speciesdb.htm

Thanks
Dale

At this time I would like to make a public Thanks to all those who helped me get my db to the point it is. LoisC, Elliot Lee, Mark Badolato, perl kid, Alex for the script, and Jpdeni for the mod thanks.

Quote Reply
Almost perfect... In reply to
I just noticed that when a user logs in as default that the data is not called in for the kept by of the from fields, but when they log in as a user the data is grabbed. Any suggestions?

Quote Reply
Re: Almost perfect... In reply to
Check your authorization permissions in both the .cfg files you have...make sure that the @auth_default_permissions array is set to the following:

Code:

@auth_default_permissions = (1,0,0,0,0);


in both of the configuration (cfg) files.

Regards,

Eliot Lee


Quote Reply
Re: Almost perfect... In reply to
Dale, when you modified the fields in the cfg files - did you also add the additional necessary |'s (pipes) in the associated databases? If not, your scripts are trying to pull info from the wrong lines in order to make up the number of fields.


Quote Reply
Re: Almost perfect... In reply to
Now that you mention it, I may have forgotten the pipes when I did my deletes. Thanks


Quote Reply
Re: Almost perfect... In reply to
Thanks for all the help. With a new copy of jpdenis .zip in hand I was able to get the entire set up to work.

Thanks
Dale