Marking Products

Results 1 to 7 of 7

Thread: Marking Products

  1. #1
    Linda Jones Guest

    Default Marking Products

    I am building an e-commerce site. I can do everything just about. My problem is I want each product to be removed from database when it has been bought. Each product is unique and cannot be bought again. I am using access and vbscript...<BR>Thnk You<BR>Linda

  2. #2
    moti Guest

    Default RE: Marking Products

    I dont know exctly how you do your checkout , but i supose that i insert some information on the db(if not no way you can do it )<BR>Insert a field on the product with a bolean value and when checking out change the value in this field by inserting different data (even if it is not boolean)<BR>And on the display of your pruduct when searching your site do another WERE only if the value is yes so after selling this product will not be displayed ( mamzon work&#039s in somwe areas with similar systems)

  3. #3
    Join Date
    Dec 1969

    Default RE: Marking Products

    Just create a new Integer field in your table called "ACTIVE" and make the default 1. After the product has been purchased, set the value to 0. (1 for active &#124 0 for inactive) When you query your products table. EX: "SELECT * FROM TBL WHERE ACTIVE = 1"<BR><BR>That will be more efficient than deleting a record every time an order is placed. This way you can have a history of products. You can then create a separate function that can archive inactive products to another table and delete or delete the inactive products.<BR><BR>Also, you may want to consider setting an index on the ACTIVE field, this will improve query performance.<BR><BR>Matt

  4. #4
    Steve Cimino Guest

    Default RE: Marking Products

    I agree with you that you shouldn&#039t actually delete the record, since you should keep some sort of identification of it if the customer complains about something.<BR><BR>I would suggest instead of using a flag, move the bought product to another table. That way, it won&#039t fill up your active product table. Yes, it will take 2 SQL statements in Access (one more reason to upgrade to SQL Server 7 -- Stored Procedures!) but I think the added overhead will pay for itself.

  5. #5
    Linda Jones Guest

    Default RE: Marking Products

    I am sorry, but I am new to all this asp stuff. Would it be possible to have a little more info on how to create these sql statements. What to put in them etc. I really appreciate your help.<BR>Lind

  6. #6
    Steve Cimino Guest

    Default RE: Marking Products

    What exactly is your product? Who is updating this database with new, unique, products, and how?<BR><BR>The advice I gave you is based on your question. Sometimes you don&#039t need an answer, you need a solution. If you&#039re that unfamilar, try posting more information. What I suggested may not be the best possible route.<BR><BR>Anyways, once you have your product purchased, add it to some other identical table, but name it "tempsomething". Use an INSERT statement:<BR><BR>INSERT into tempsomething VALUES(List, them, all, here)<BR><BR>If there are no errors, delete the existing record from your original table (this will save lookup time later on -- I have no idea how big your tables are)<BR><BR>DELETE from OriginalTable<BR>WHERE whatmakesthisrecordunique<BR><BR>I&#039m running short on time, but I think you get the idea.

  7. #7
    Skippie Guest

    Default RE: Marking Products

    I regret to say that you really should become more familiar with<BR>ASP and SQL before continuing with your project. Otherwise, <BR>someone would have to do just about everything for you.<BR><BR>You should start off by reading "SQL for Dummies", then<BR>"Professional Active Server Pages".<BR><BR>You sound like a mechanic asking how to use a socket wrench.<BR><BR>-- Skippie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts