Re: SKU Question

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 24363
interpreted = N
texte = Aaron, Thanks for your explanation it is very clear and a very good solution, but what happens if two different users are adding items at the same time, I mean, when a user are filling the data of the item and before he go to the second page other user fill faster his data, both have the same newsku value, one of them will replace the data of the other.Are there a way to do the search and give the value of the newsku in the second page? How can I create a variable like newsku without a form?Thanks again for you help. Rodolfo de la GarzaThe 11/14/99 1:59 AM Aaron Lynch aaron@DigitalSpeed.com Wrote>on page 1 >db=mydatabase.db&neskudata=bogus&deskusort=1&skutype=numm&max=1][founditem >s][math][sku]+1[/math][/founditems][/search]> > >on page 2 > >[replace >db=mydatabase.db&eqskudata=[newsku]&append=t]sku=[newsku]&yourdata=[someva >riable][/replace] > > > >ok, to summerize, you search the database to find all items whose sku data >does Not Equal' >Bogus so we're going to find every record, right? ok, then 'DEscending >sku sort' so the >highest sku will show first. then skutype = number, so that it knows to >sort numerically, >and not alphabetically, and then max=1, because of all those sku's we just >found, we're >only interested in the first one, the highest one. > >then it's simple math, the highest sku in the db +1 gets you a new sku. > >say, for example you have a new db, the number found in the result will be >nothing, plus >one. so newsku=1. > >then on page two we replace the record with sku 1, normally, replace won't >do that, >because sku 1 doesn't exist, which is why we put append=t in there. so >replace 1 and if >it's not there append it. > >if the user reloads at this point, record 1 is replaced. but the sku is >not incremented. > >this is all in the docs but kinda hard to grasp, > > >HTH >-Aaron > >Rodolfo de la Garza wrote: > >> I tried what Jesse recommend using it this way: >> >> [search db=mydatabase.db&eqSKUdata=[sku]][founditems][showif >> [numFound]=0] [append] >> [/showif][/founditems] >> >> If it is the first time I use this SKU, I suppose that [numFound] will be >> 0 but it doesn't append it, I don't know why. >> >> Am I doing somethig wrong? >> >> On the other hand, Howard said: >> >> you could generate the SKU on the same form >> where they enter the rest of the info, and on the submitted page,. Then, >> if they go back and submit again, the record >> will not be added because the replace will already see a record with that >> sku, so it will replace it, otherwise if it doesn't aleady exist, it will >> add it. >> >> I don't understand, what does use a replace with append=t means. >> I'm just learning. >> >> Ken said: >> use an append context and put the code that creates your SKU inside the >> context instead of in the form >> >> I'm using the append context and I can do it. It is true the SKU will be >> not duplcated (Good Idea) but the item will be duplicated with different >> SKU. >> >> Are there a way to prevent this? >> >> Thanks for your support. >> >> Rodolfo de la Garza >> >> The 11/13/99 12:47 PM Jesse Williams Proudman lists@ninewire.com wrote >> >> >On the page that appends it, check to see if the sku is in use with a >> >search. >> > >> >Jesse Williams Proudman - NineWire Production >> > http://www.ninewire.com <-> Jesse@ninewire.com >> > Innovative and Creative Web Design and Hosting >> > >> >> -----Original Message----- >> >> From: WebCatalog Talk [mailto:WebDNA-Talk@talk.smithmicro.com]On >> >> Behalf Of Rodolfo de la Garza >> >> Sent: Saturday, November 13, 1999 10:47 AM >> >> To: WebCatalog Talk >> >> Subject: SKU Question >> >> >> >> >> >> Hi there, >> >> >> >> How can I prevent SKU to be duplicated by error? >> >> If the user click the back button and submit again the item the SKU will >> >> be duplicated. >> >> >> >> Any Idea? >> >> >> >> Thanks. >> >> >> >> >> >> ------------------------------------------------------------- >> >> Brought to you by CommuniGate Pro - The Buzz Word Compliant >> >> Messaging Server. >> >> To end your Mail problems go to . >> >> >> >> 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 >> >> >> >> >> > >> > >> >------------------------------------------------------------- >> >Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging >> Server. >> >To end your Mail problems go to . >> > >> >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 >> > >> >> ------------------------------------------------------------- >> Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. >> To end your Mail problems go to . >> >> 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 > > > >------------------------------------------------------------- >Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. >To end your Mail problems go to . > >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 > ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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 Associated Messages, from the most recent to the oldest:

    
  1. Re: SKU Question (Aaron Lynch 1999)
  2. Re: SKU Question (Jesse Williams Proudman 1999)
  3. Re: SKU Question (J. A. Hill 1999)
  4. Re: SKU Question (Rodolfo de la Garza 1999)
  5. Re: SKU Question (Aaron Lynch 1999)
  6. Re: SKU Question (Rodolfo de la Garza 1999)
  7. Re: SKU Question (Kenneth Grome 1999)
  8. Re: SKU Question (Howard Wolosky 1999)
  9. Re: SKU Question (Jesse Williams Proudman 1999)
  10. SKU Question (Rodolfo de la Garza 1999)
Aaron, Thanks for your explanation it is very clear and a very good solution, but what happens if two different users are adding items at the same time, I mean, when a user are filling the data of the item and before he go to the second page other user fill faster his data, both have the same newsku value, one of them will replace the data of the other.Are there a way to do the search and give the value of the newsku in the second page? How can I create a variable like newsku without a form?Thanks again for you help. Rodolfo de la GarzaThe 11/14/99 1:59 AM Aaron Lynch aaron@DigitalSpeed.com Wrote>on page 1 >db=mydatabase.db&neskudata=bogus&deskusort=1&skutype=numm&max=1][founditem >s][math][sku]+1[/math][/founditems][/search]> > >on page 2 > >[replace >db=mydatabase.db&eqskudata=[newsku]&append=t]sku=[newsku]&yourdata=[someva >riable][/replace] > > > >ok, to summerize, you search the database to find all items whose sku data >does Not Equal' >Bogus so we're going to find every record, right? ok, then 'DEscending >sku sort' so the >highest sku will show first. then skutype = number, so that it knows to >sort numerically, >and not alphabetically, and then max=1, because of all those sku's we just >found, we're >only interested in the first one, the highest one. > >then it's simple math, the highest sku in the db +1 gets you a new sku. > >say, for example you have a new db, the number found in the result will be >nothing, plus >one. so newsku=1. > >then on page two we replace the record with sku 1, normally, replace won't >do that, >because sku 1 doesn't exist, which is why we put append=t in there. so >replace 1 and if >it's not there append it. > >if the user reloads at this point, record 1 is replaced. but the sku is >not incremented. > >this is all in the docs but kinda hard to grasp, > > >HTH >-Aaron > >Rodolfo de la Garza wrote: > >> I tried what Jesse recommend using it this way: >> >> [search db=mydatabase.db&eqSKUdata=[sku]][founditems][showif >> [numFound]=0] [append] >> [/showif][/founditems] >> >> If it is the first time I use this SKU, I suppose that [numFound] will be >> 0 but it doesn't append it, I don't know why. >> >> Am I doing somethig wrong? >> >> On the other hand, Howard said: >> >> you could generate the SKU on the same form >> where they enter the rest of the info, and on the submitted page,. Then, >> if they go back and submit again, the record >> will not be added because the replace will already see a record with that >> sku, so it will replace it, otherwise if it doesn't aleady exist, it will >> add it. >> >> I don't understand, what does use a replace with append=t means. >> I'm just learning. >> >> Ken said: >> use an append context and put the code that creates your SKU inside the >> context instead of in the form >> >> I'm using the append context and I can do it. It is true the SKU will be >> not duplcated (Good Idea) but the item will be duplicated with different >> SKU. >> >> Are there a way to prevent this? >> >> Thanks for your support. >> >> Rodolfo de la Garza >> >> The 11/13/99 12:47 PM Jesse Williams Proudman lists@ninewire.com wrote >> >> >On the page that appends it, check to see if the sku is in use with a >> >search. >> > >> >Jesse Williams Proudman - NineWire Production >> > http://www.ninewire.com <-> Jesse@ninewire.com >> > Innovative and Creative Web Design and Hosting >> > >> >> -----Original Message----- >> >> From: WebCatalog Talk [mailto:WebDNA-Talk@talk.smithmicro.com]On >> >> Behalf Of Rodolfo de la Garza >> >> Sent: Saturday, November 13, 1999 10:47 AM >> >> To: WebCatalog Talk >> >> Subject: SKU Question >> >> >> >> >> >> Hi there, >> >> >> >> How can I prevent SKU to be duplicated by error? >> >> If the user click the back button and submit again the item the SKU will >> >> be duplicated. >> >> >> >> Any Idea? >> >> >> >> Thanks. >> >> >> >> >> >> ------------------------------------------------------------- >> >> Brought to you by CommuniGate Pro - The Buzz Word Compliant >> >> Messaging Server. >> >> To end your Mail problems go to . >> >> >> >> 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 >> >> >> >> >> > >> > >> >------------------------------------------------------------- >> >Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging >> Server. >> >To end your Mail problems go to . >> > >> >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 >> > >> >> ------------------------------------------------------------- >> Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. >> To end your Mail problems go to . >> >> 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 > > > >------------------------------------------------------------- >Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. >To end your Mail problems go to . > >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 > ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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 Rodolfo de la Garza

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:

Slow Server (2005) [WebDNA] Receive JSON POST (2019) Webmessage Hyperboard (1998) Re:multiple digests, please stop (1997) search/showif issues (2000) Gil's in the lead (1999) Help name our technology! (1997) hard carriage returns and sendmail (1998) Protect (1997) AOL and [redirect] (2000) Why is deleting so slow? (2002) Banner DNA (1997) Getting total number of items ordered (1997) [spawn] processes (2004) PIXO support (1997) RE: Upload (1998) Newbie problem blah blah blah (1997) encrypted query string trouble on OSX (2001) Searching multiple Databases (1997) [OT] Mom's gift (2006)