Re: temporary database? an aside

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 34862
interpreted = N
texte = Steven-[formvariables] will display all of the form variables that are passed to a page (of course in my example, the page passes them to itself). Formvariables will loop through all of these variables, which gives me a handy way of doing my [replaces] in the database.Tacking another variable onto the end of a variable (as i've done) gives me a convenient, shorthand way of giving the variable on each founditems line a unique name, and I can recover what its value was set to with the formvariables context.Here's a simple example. Suppose I have an online store shirthaus.com Customers can order shirts and specify the size. So, my orders.db looks something like:Name OrderNumber Size SKU John Q 20 S 001 John Q 20 M 003 Joe B 21 M 002 Jane D 22 XL 005Notice that John Q has ordered 2 shirts, one small and one medium. Joe has ordered a medium shirt and Jane has ordered and extralarge shirt.Now, let's say I want to give customers access to this db, to change a size before I ship the order to them.What I'll do is create a template that'll search the database, based on, say the order number. I'll have a table on the results page that'll display the founditems. Let's take John has an example. This is what the table on the customer login page will look like:You ordered the follwing items. Please make any changes to size by 5 pm today:Name Ordernumber Size SKU John Q 20 S 001 John Q 20 M 003 Now, the only field John can change is size. So, the HTML for that formvariable looks likeWhat this code does is create two formvariables when the html parses, right? One is named size001 and the other is size003 (size+[sku]).OK, so far so good. Now, let's say John is has used my form to change the size of the first shirt in his order to large. When he hits 'submit', the new values for these variables are going to be re-presented to the page (because the action of the form points to this page) and now I am going to take these new values and change what's in my database to reflect the change. Since formvariables will give me a list of all the variables presented to the page, I can simply do:[formvariables] [showif [made_db_changes]=T] [replace db=orders.db&eqordernumberdata=[ordernumber]&eqskudata=[sku]]size=[interpre t][size[sku]][/interpret] [/showif] [/formvariables]One helpful way to figure out what contexts are doing is to go ahead and replace the variables with their values and it becomes pretty clear what is going on:What'll happen with the above is:[replace db=orders.db&ordernumber=20&eqskudata=001]size=L [/replace] [replace db=orders.db&ordernumber=20&eqskudata=003]size=M [/replace]I hope this clarifies things. The best way to understand these concepts is to make a simple database and template, and mess with it until you understand how all of this works...(and, keeping asking questions ;) -- Will Starck NovaDerm Product and Technical Support http://www.novaderm.com techs@novaderm.com> From: Steven Jarvis > Reply-To: (WebCatalog Talk) > Date: Wed, 19 Jul 2000 11:55:38 > To: (WebCatalog Talk) > Subject: Re: temporary database? an aside > > Will, > > >> 4) Place the following code snippet (modify to suit your situation) just >> inside the founditems of the search: >> >> >> [formvariables] >> [showif [made_db_changes]=T] >> [replace >> db=orders.db&eqordernamedata=[ordername]]materials=[interpret][materials[ord >> ername]][/interpret] >> [/showif] >> [/formvariables] >> >> > > I'm new to WC, and I've seen quite a bit of code around here (designed by my > predecessor) and on the list where the formvariables context is wrapped > around a bunch of code. > > The docs don't seem to indicate any such useof that context. Can you (or > someone else) explain why you do that? > > Thanks! > > Steve > > > ------------------------------------------------ > Steven Jarvis > Web Developer > sjarvis@nwaonline.net > > Morning News of Northwest Arkansas > http://www.nwaonline.net > ------------------------------------------------ > > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://search.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: temporary database? an aside (Will Starck 2000)
  2. Re: temporary database? an aside (Steven Jarvis 2000)
Steven-[formvariables] will display all of the form variables that are passed to a page (of course in my example, the page passes them to itself). Formvariables will loop through all of these variables, which gives me a handy way of doing my [replaces] in the database.Tacking another variable onto the end of a variable (as i've done) gives me a convenient, shorthand way of giving the variable on each founditems line a unique name, and I can recover what its value was set to with the formvariables context.Here's a simple example. Suppose I have an online store shirthaus.com Customers can order shirts and specify the size. So, my orders.db looks something like:Name OrderNumber Size SKU John Q 20 S 001 John Q 20 M 003 Joe B 21 M 002 Jane D 22 XL 005Notice that John Q has ordered 2 shirts, one small and one medium. Joe has ordered a medium shirt and Jane has ordered and extralarge shirt.Now, let's say I want to give customers access to this db, to change a size before I ship the order to them.What I'll do is create a template that'll search the database, based on, say the order number. I'll have a table on the results page that'll display the founditems. Let's take John has an example. This is what the table on the customer login page will look like:You ordered the follwing items. Please make any changes to size by 5 pm today:Name Ordernumber Size SKU John Q 20 S 001 John Q 20 M 003 Now, the only field John can change is size. So, the HTML for that formvariable looks likeWhat this code does is create two formvariables when the html parses, right? One is named size001 and the other is size003 (size+[sku]).OK, so far so good. Now, let's say John is has used my form to change the size of the first shirt in his order to large. When he hits 'submit', the new values for these variables are going to be re-presented to the page (because the action of the form points to this page) and now I am going to take these new values and change what's in my database to reflect the change. Since formvariables will give me a list of all the variables presented to the page, I can simply do:[formvariables] [showif [made_db_changes]=T] [replace db=orders.db&eqordernumberdata=[ordernumber]&eqskudata=[sku]]size=[interpre t][size[sku]][/interpret] [/showif] [/formvariables]One helpful way to figure out what contexts are doing is to go ahead and replace the variables with their values and it becomes pretty clear what is going on:What'll happen with the above is:[replace db=orders.db&ordernumber=20&eqskudata=001]size=L [/replace] [replace db=orders.db&ordernumber=20&eqskudata=003]size=M [/replace]I hope this clarifies things. The best way to understand these concepts is to make a simple database and template, and mess with it until you understand how all of this works...(and, keeping asking questions ;) -- Will Starck NovaDerm Product and Technical Support http://www.novaderm.com techs@novaderm.com> From: Steven Jarvis > Reply-To: (WebCatalog Talk) > Date: Wed, 19 Jul 2000 11:55:38 > To: (WebCatalog Talk) > Subject: Re: temporary database? an aside > > Will, > > >> 4) Place the following code snippet (modify to suit your situation) just >> inside the founditems of the search: >> >> >> [formvariables] >> [showif [made_db_changes]=T] >> [replace >> db=orders.db&eqordernamedata=[ordername]]materials=[interpret][materials[ord >> ername]][/interpret] >> [/showif] >> [/formvariables] >> >> > > I'm new to WC, and I've seen quite a bit of code around here (designed by my > predecessor) and on the list where the formvariables context is wrapped > around a bunch of code. > > The docs don't seem to indicate any such useof that context. Can you (or > someone else) explain why you do that? > > Thanks! > > Steve > > > ------------------------------------------------ > Steven Jarvis > Web Developer > sjarvis@nwaonline.net > > Morning News of Northwest Arkansas > http://www.nwaonline.net > ------------------------------------------------ > > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://search.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Will Starck

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WCS Newbie question (1997) Emailer setup (1997) WebCat2: Items xx to xx shown, etc. (1997) RE: IIS4b2 and WebCatalog b19 (1997) Error -108 (1997) searchable list archive (1997) Post arguments problem mac? (1997) French Webcat User (2002) Shopping Cart Problem (1998) AppleScript/.db (was:FTP to WebStar) (2001) Re:no [search] with NT (1997) Include a big block of text (1997) Balancing randomness (2000) Need help with Shipping/Price discounts (1998) Help with Repost Data msg from form (1997) Help name our technology! I found it (1997) WC2b12: Yes, Formulas.db is for real (1997) [WebDNA] Yosemite (2014) Forumulas.db & Variables (2002) html delivery (1997)