POSTing to XML...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • transpar3nt

    POSTing to XML...

    Hello, I am building a small app for the electronics store I work for
    that allows employees to enter product information and it outputs a
    printable sales estimate for the customer. I have it working
    flawlessly, except that since I am using a MySQL database to store the
    input info, I am limited by the number of rows in the db table (20
    sets of each field type = 20 item rows on the printout).

    I am looking to pursue an XML approach which would allow me unlimited
    number of items (each item has a description, qty, price, etc.). When
    the user needs to add an item they simply click "add item" and
    JavaScript populates another set of form fields meant for another
    <itemelement. Unfortunately, since POST only accepts unique names
    for each field I can't seem to figure out how to produce the xml so
    each section of fields produces one item element and several
    subelements.

    How would I tell the script that I am grouping each of the item fields
    (itemDesc1, itemPrice1, itemQty1, etc) together and to separate them
    from (itemDesc2, etc.)?

    I hope I'm clear about this, I am brand new to working with XML (oh
    I'm using the DOM in PHP to produce the XML).

    Thanks for any advice you may give.

    - Keith
  • transpar3nt

    #2
    Re: POSTing to XML...

    UPDATE: This is roughly what I want the XML to look like...

    <estimate estID="55302" taxRate="6" date="09-30-2008">
    <item taxed="1">
    <itemDesc>50" Pioneer Plasma TV</itemDesc>
    <model>PDP-50</model>
    <qty>2</qty>
    <price>5000</price>
    <itemTotal>1060 0</itemTotal>
    </item>
    <item taxed="0">
    <itemDesc>8ft Monster HDMI</itemDesc>
    <model>Ultra 800</model>
    <qty>1</qty>
    <price>129.99 </price>
    <itemTotal>137. 79</itemTotal>
    </item>
    </estimate>

    Comment

    • transpar3nt

      #3
      Re: POSTing to XML...

      UPDATE: This is roughly what I want the XML to look like...

      <estimate estID="55302" taxRate="6" date="09-30-2008">
      <item taxed="1">
      <description>50 " Pioneer Plasma TV</description>
      <model>PDP-50</model>
      <qty>2</qty>
      <price>5000</price>
      <itemTotal>1060 0</itemTotal>
      </item>
      <item taxed="0">
      <description>8f t Monster HDMI</description>
      <model>Ultra 800</model>
      <qty>1</qty>
      <price>129.99 </price>
      <itemTotal>137. 79</itemTotal>
      </item>
      </estimate>

      Comment

      • rf

        #4
        Re: POSTing to XML...


        "transpar3n t" <casperghosty@g mail.comwrote in message
        news:1859d338-1b56-4f2b-96de-593ac3c6dd40@d4 5g2000hsc.googl egroups.com...
        Hello, I am building a small app for the electronics store I work for
        that allows employees to enter product information and it outputs a
        printable sales estimate for the customer. I have it working
        flawlessly, except that since I am using a MySQL database to store the
        input info, I am limited by the number of rows in the db table (20
        sets of each field type = 20 item rows on the printout).
        Never heard of such a limit.


        Comment

        • Captain Paralytic

          #5
          Re: POSTing to XML...

          On 2 Oct, 07:33, transpar3nt <caspergho...@g mail.comwrote:
          Hello, I am building a small app for the electronics store I work for
          that allows employees to enter product information and it outputs a
          printable sales estimate for the customer.  I have it working
          flawlessly, except that since I am using a MySQL database to store the
          input info, I am limited by the number of rows in the db table (20
          sets of each field type = 20 item rows on the printout).
          Please explain where this limit comes from as MySQL itself has no such
          limits.

          Comment

          • Jerry Stuckle

            #6
            Re: POSTing to XML...

            transpar3nt wrote:
            Hello, I am building a small app for the electronics store I work for
            that allows employees to enter product information and it outputs a
            printable sales estimate for the customer. I have it working
            flawlessly, except that since I am using a MySQL database to store the
            input info, I am limited by the number of rows in the db table (20
            sets of each field type = 20 item rows on the printout).
            >
            I am looking to pursue an XML approach which would allow me unlimited
            number of items (each item has a description, qty, price, etc.). When
            the user needs to add an item they simply click "add item" and
            JavaScript populates another set of form fields meant for another
            <itemelement. Unfortunately, since POST only accepts unique names
            for each field I can't seem to figure out how to produce the xml so
            each section of fields produces one item element and several
            subelements.
            >
            How would I tell the script that I am grouping each of the item fields
            (itemDesc1, itemPrice1, itemQty1, etc) together and to separate them
            from (itemDesc2, etc.)?
            >
            I hope I'm clear about this, I am brand new to working with XML (oh
            I'm using the DOM in PHP to produce the XML).
            >
            Thanks for any advice you may give.
            >
            - Keith
            >
            There is no such limit in MySQL. And a database is the way to go - not XML.

            But this is a bad design, anyway. Read up on database normalization,
            and if you're still having trouble with your database design try
            comp.databases. mysql.

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?=

              #7
              Re: POSTing to XML...

              rf escribió:
              "transpar3n t" <casperghosty@g mail.comwrote in message
              news:1859d338-1b56-4f2b-96de-593ac3c6dd40@d4 5g2000hsc.googl egroups.com...
              >Hello, I am building a small app for the electronics store I work for
              >that allows employees to enter product information and it outputs a
              >printable sales estimate for the customer. I have it working
              >flawlessly, except that since I am using a MySQL database to store the
              >input info, I am limited by the number of rows in the db table (20
              >sets of each field type = 20 item rows on the printout).
              >
              Never heard of such a limit.
              The OP is probably using a estimates table with this columns: estID,
              taxRate, date, description1, description2, description3... description20

              .... and he's hitting the DB engine's max column size limit:



              The obvious suggestion:

              estimates: estID, taxRate, date
              items: itemID, estID, taxed, description, model...

              And them some _basic_ SQL abilities you car earn in a few minutes.


              --
              -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
              -- Mi sitio sobre programación web: http://bits.demogracia.com
              -- Mi web de humor al baño María: http://www.demogracia.com
              --

              Comment

              • rf

                #8
                Re: POSTing to XML...


                ""Álvaro G. Vicario"" <alvaroNOSPAMTH ANKS@demogracia .comwrote in message
                news:gc2egs$9lj $1@huron.algoma s.org...
                rf escribió:
                >"transpar3nt " <casperghosty@g mail.comwrote in message
                >news:1859d33 8-1b56-4f2b-96de-593ac3c6dd40@d4 5g2000hsc.googl egroups.com...
                >>Hello, I am building a small app for the electronics store I work for
                >>that allows employees to enter product information and it outputs a
                >>printable sales estimate for the customer. I have it working
                >>flawlessly, except that since I am using a MySQL database to store the
                >>input info, I am limited by the number of rows in the db table (20
                >>sets of each field type = 20 item rows on the printout).
                >>
                >Never heard of such a limit.
                >
                The OP is probably using a estimates table with this columns: estID,
                taxRate, date, description1, description2, description3... description20
                >
                ... and he's hitting the DB engine's max column size limit:
                >>input info, I am limited by the number of rows in the db table (20
                Rows. The OP said rows. No limit, and most certainly not 20.

                And what is the maximum column size in mysql? Larger than the size of your
                disk drive. Most certainly not 20.


                Comment

                • =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?=

                  #9
                  Re: POSTing to XML...

                  rf escribió:
                  >... and he's hitting the DB engine's max column size limit:
                  >
                  >>>input info, I am limited by the number of rows in the db table (20
                  >
                  Rows. The OP said rows. No limit, and most certainly not 20.
                  Certainly not. I just doubt he actually meant *database* rows.
                  And what is the maximum column size in mysql? Larger than the size of your
                  disk drive. Most certainly not 20.
                  The link I posted states: "Every table has a maximum row size of 65,535
                  bytes". And then it explains situations in which it can be even lower.
                  Of course, you can store much more data in a row, but you use BLOBs for
                  that (they are stored separately).

                  P.S. I didn't really know: I was curious about the subject and did some
                  research ;-)

                  --
                  -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
                  -- Mi sitio sobre programación web: http://bits.demogracia.com
                  -- Mi web de humor al baño María: http://www.demogracia.com
                  --

                  Comment

                  • transpar3nt

                    #10
                    Re: POSTing to XML...

                    On Oct 2, 6:23 am, "Álvaro G. Vicario"
                    <alvaroNOSPAMTH A...@demogracia .comwrote:
                    rf escribió:
                    >
                    "transpar3n t" <caspergho...@g mail.comwrote in message
                    news:1859d338-1b56-4f2b-96de-593ac3c6dd40@d4 5g2000hsc.googl egroups.com....
                    Hello, I am building a small app for the electronics store I work for
                    that allows employees to enter product information and it outputs a
                    printable sales estimate for the customer.  I have it working
                    flawlessly, except that since I am using a MySQL database to store the
                    input info, I am limited by the number of rows in the db table (20
                    sets of each field type = 20 item rows on the printout).
                    >
                    Never heard of such a limit.
                    >
                    The OP is probably using a estimates table with this columns: estID,
                    taxRate, date, description1, description2, description3... description20
                    >
                    ... and he's hitting the DB engine's max column size limit:
                    >

                    >
                    The obvious suggestion:
                    >
                    estimates: estID, taxRate, date
                    items: itemID, estID, taxed, description, model...
                    >
                    And them some _basic_ SQL abilities you car earn in a few minutes.
                    >

                    Thank you Álvaro G. Vicario, you seemed to have the right idea. I
                    thought of doing that and figured XML might be a way to go. Your
                    first example of the DB was similar to how I had it before, and the
                    2nd was what I considered switching to as apposed to XML. Obviously
                    I'm not as experienced as I would like to be, but thanks to this group
                    I am getting there :) The MySQL db is the way I will go, I'll just
                    flesh out the new design.

                    - Keith

                    Comment

                    Working...