Gossamer Forum
Home : Products : DBMan : Discussions :

Can Anyone Help

Quote Reply
Can Anyone Help
Hi,

CAN ANYONE HELP

I've been playing with DBman and having a problem trying to do the following:

I have a Customer Database that links to a Product Database (with common field of CustomerID), all is working fine but how do I get DBman to accept multiple ADD records off the one ADD Form.

i.e. Product 1, description, price | Product 2, description, price | Product 3 description, price on ADD FORM with check boxes could be added to Product Database as three different records.
Quote Reply
Re: [RobR] Can Anyone Help In reply to
If you are using the relational mod I think it would be best to have users login to the customer database to add their information. Then from there provide the links to add, modify, and delete products from the products database.

Once they login you can provide the choices on a main page for them to enter their products.

In the FAQ noted below under relational databases there are several examples, and tips and tricks for working with relational databases.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Can Anyone Help In reply to
Many thanks for your quick response and apologies for adding my enquiry to the wrong section first...

But, I might be being a little dull, but I can't find a solution to the original problem.

I'll try to explain it a different way, sorry...

Right customer does a product search, in the result say 10 product are shown. The customer can then choose say 4 products using a 'check box' then clicks on a 'Add button' at bottom of page and this then adds the 4 selected product to a request database as 4 seperate records.

Thanks again
Quote Reply
Re: [RobR] Can Anyone Help In reply to
I can see 2 ways to hack something like that, but their might be a correct answer out there somewhere;

1. loop the add_record sub back to itself using some kind of a marking variable to know when to stop????


2. the only difference between a field and a record is a line break, so write the output with duplicated Customer ID's and line breaks between the products.

OK, here is #3

Since the products must come from a database somewhere, just store the ID of the product, then store all the product ID's in a single field, using multiple records for different orders.
Quote Reply
Re: [joematt] Can Anyone Help In reply to
Thanks for the suggestion

I've attached two files, which have been hacked from a working shopping cart...

Any ideas how they could work with DBman

Thanks again for the help
Quote Reply
Re: [RobR] Can Anyone Help In reply to
You are welcome.

Quote:
Any ideas how they could work with DBman

That's a rather wide open question. Smile

My question would be what aspects of the entire ordering/order filling process could be done with DBman better than some other script or visa versa?

For the html file, unless you literally have just 3 items to sell, it would seem more efficient to enter items into a database and have a script generate the required html for the order form. Dbman does this very well using various MODs.

In terms of processing the form data, and the various calculations that I see in the hacked script you provided, it "probably" could be incorportated into a DBman install either as a call to a separate script or as a sub within the script. I did notice that the "other" script seems to be handling the formatting of the database differently.

I take it that the other script is just a shopping cart and not as full featured as DBman and that is why you want to integrate them? Or is it a software cost issue?
Quote Reply
Re: [joematt] Can Anyone Help In reply to
Thanks for the quick reply.

Yes it was taken from a basic shopping cart, but is able to add multiple products to the database at the same time rather than the norm 1 at a time.

If you know how to do this within DBman that would solve the problem all together

Thanks again
Quote Reply
Re: [RobR] Can Anyone Help In reply to
Have you by any chance looked at the shopping cart mod written for DBMan?

I haven't used it yet myself, but it may provide some ideas for you.

ORDERnary - a simple shopping cart mod
by Ograin

I believe there is a link in the Resource Center for the demo and DBMan files.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [RobR] Can Anyone Help In reply to
Quote:
add multiple products to the database at the same time rather than the norm 1 at a time.

I found a few things for you to ponder, but nothing so easy.

this one says it can be done, and I think it just adds the end of line character between records, but does not look like it has been tested.

http://www.gossamer-threads.com/...i?post=152881#152881

And this one is suggesting you switch to dbman SQL Smile

http://www.gossamer-threads.com/...i?post=220009#220009

I found another that pointed out that the problem with adding multiple records was the assigning of a unique key as the records are added, and that this is why you can modify multiple records (as the key exists in the record) but not add multiple. SO ...

Quick and dirty ... populate a database with records that have only the key value, then when a user wants to "add", use the modify_multiple MOD to present the next set of records that are "key only". ??? Problem might be how to keep track of which records are being modified during the modification by the user, but another counter file might solve that.

Well there are the 3 solutions, to a very old problem I might add.

Solve this and you could be famous!