Connecting Tech Pros Worldwide Forums | Help | Site Map

Present data and input in the database

Newbie
 
Join Date: Jul 2008
Posts: 30
#1: Sep 24 '09
Hi,

I have a list of data need to put into mySQL and present them in a webpage.
How could I presnet the attached data sheet?

The top title is the item_no. First column is the size. Each item_no with the specific length size has a conductor size. But not every item has a length size and/or conductor size.


Many Thanks.
Attached Thumbnails
data.jpg  

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,648
#2: Sep 24 '09

re: Present data and input in the database


Quote:

Originally Posted by yimma216 View Post

But not every item has a length size and/or conductor size.

then use a reasonable default value (like 0 or NULL)
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,748
#3: Sep 24 '09

re: Present data and input in the database


Hey.

What about a MySQL table like this?
Expand|Select|Wrap|Line Numbers
  1. +--------+--------+------+------+
  2. | ItemNO | Length | CMin | CMax |
  3. +--------+--------+------+------+
  4. | RD5545 | 32.5   | 0    | 14   |
  5. | RD5545 | 45     | 0    | 32   |
  6. | RD5560 | 45     | 0    | 18   |
  7. | RD5560 | 55     | 0    | 38   |
  8. | RD5575 | 55     | 0    | 28   |
  9. +--------+--------+------+------+
There is no need to list ItemNo/Size combos that have no value. You would just add them to the list later on if they are needed.

As for displaying the table, the spreadsheet-like format in your image is easily replicated in HTML with a simple HTML table.
Newbie
 
Join Date: Jul 2008
Posts: 30
#4: Sep 28 '09

re: Present data and input in the database


Thank both of you. I will try to work on your sample, Atli.
Reply