By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

POSTing to XML...

P: n/a
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
Oct 2 '08 #1
Share this Question
Share on Google+
9 Replies


P: n/a
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>10600</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>

Oct 2 '08 #2

P: n/a
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>10600</itemTotal>
</item>
<item taxed="0">
<description>8ft Monster HDMI</description>
<model>Ultra 800</model>
<qty>1</qty>
<price>129.99</price>
<itemTotal>137.79</itemTotal>
</item>
</estimate>
Oct 2 '08 #3

P: n/a
rf

"transpar3nt" <ca**********@gmail.comwrote in message
news:18**********************************@d45g2000 hsc.googlegroups.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.
Oct 2 '08 #4

P: n/a
On 2 Oct, 07:33, transpar3nt <caspergho...@gmail.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.
Oct 2 '08 #5

P: n/a
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.
js*******@attglobal.net
==================

Oct 2 '08 #6

P: n/a
rf escribió:
"transpar3nt" <ca**********@gmail.comwrote in message
news:18**********************************@d45g2000 hsc.googlegroups.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:

http://dev.mysql.com/doc/refman/5.0/...unt-limit.html

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
--
Oct 2 '08 #7

P: n/a
rf

""Álvaro G. Vicario"" <al****************@demogracia.comwrote in message
news:gc**********@huron.algomas.org...
rf escribió:
>"transpar3nt" <ca**********@gmail.comwrote in message
news:18**********************************@d45g200 0hsc.googlegroups.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.
Oct 2 '08 #8

P: n/a
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
--
Oct 2 '08 #9

P: n/a
On Oct 2, 6:23*am, "Álvaro G. Vicario"
<alvaroNOSPAMTHA...@demogracia.comwrote:
rf escribió:
"transpar3nt" <caspergho...@gmail.comwrote in message
news:18**********************************@d45g2000 hsc.googlegroups.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:

http://dev.mysql.com/doc/refman/5.0/...unt-limit.html

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
Oct 3 '08 #10

This discussion thread is closed

Replies have been disabled for this discussion.