Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I am still new with MySQL and seek advice from the monks of PM.

I am creating a mini shopping cart and I need some help to make sure I am getting the tables correct. There are 4 tables.

--------- --------- |products| | temp | --------- --------- id id name zip desc email price userid weight shiprice shipinfo subtotal total coupon ip ----------- ----------- |temporder| |order | ----------- ----------- id id ??? userid subtotal total shipcost shipmethod name, address, zip, phone, etc..
I have one table for all the products. One temp table which puts their CURRENT order into while they are surfing the site. The order table pulls the information out of the temp table once the order was verified via PayPal's IPN. The temporder table I have no idea what to do with.

I am lost as to how to add all the user's products and qty's to a table without making a new table for each person. That seems very, very costly but I don't know any other way to do it. I need the current items and quantities in both the temporder and the order table (or somehow related so I can pull it back later).

I could in reality make an order table and make duplicate USERID rows and have items/quantities that way and just search for rows that have the USERID in question. This means more reasonable than a new table but depending on the database size, could be costly as well.

Does anyone know of a simple way to add their items/qty's to the table(s)?

In reply to setting up pseudo tables in mysql shopping cart by coldfingertips

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2022-12-08 02:27 GMT
Find Nodes?
    Voting Booth?

    No recent polls found