473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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
Oct 2 '08 #1
9 1265
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

145
by: David MacQuigg | last post by:
Playing with Prothon today, I am fascinated by the idea of eliminating classes in Python. I'm trying to figure out what fundamental benefit there is to having classes. Is all this complexity...
2
by: Jonathan M. Rose | last post by:
I am looking for a script that I can sit on an HTML server (Linux, Apache, PHP/Perl/Python/Etc.) that will allow me to do the following things: 1) Post news articles that consists of (i) a title...
21
by: Davinder | last post by:
can anyone recommend a good tool to convert documents to HTML on the fly. I need to integrate this tool with a VB app so it must have an API. thanks in advance Davinder davinder@gujral.co.uk
12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
54
by: Brett Baisley | last post by:
Hello, I am trying to figure out how to change the default font-family and font-size. I tried adding this to the BODY section, but it didn't work. I tried to the P section, but they are not...
33
by: Philip Herlihy | last post by:
I'm creating a common navigation bar of text "buttons" using CSS. On each page, I want the corresponding button to be "inert" (no hover, etc) as a visual clue to where you are. I thought I'd...
3
by: Roger Walter | last post by:
I have a .Net web page that is posting twice after the submit button is clicked once. How can that happen? I have turned tracing on and it writes two records to the trace log and posts twice. ...
2
by: m | last post by:
Hi All, I m extremely sorry if this is the wrong place to post it but i just need some info on the MS Posting Acceptor. 1) Is MS Posting Acceptor available with IIS5.0 and above. 2)If so where...
44
by: Bruce Wood | last post by:
This subject has come up several times in this group over the last year. Several people in this group seem to feel strongly about this topic. Rather than derail other threads with this discussion,...
27
by: Alan T | last post by:
I am not sure which way to go: Want to learn C# but C# is implemented both in Windows desktop application and ASP.NET. I am not familiar with web programming, should I start with Windows app or...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.