User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 375,218 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,273 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Database Design advertiser:

Items with some, but not all, fields in common

Join Date: Jan 2008
Posts: 71
Reputation: amigura is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 7
amigura's Avatar
amigura amigura is offline Offline
Junior Poster in Training

Re: Items with some, but not all, fields in common

  #6  
Apr 27th, 2008
you talk about blank fields, weell that would depend on what u want in your report. if you want table1 in report then there are no blanks. but if you want table2 then there will be blanks as there will be no data for some fields. if you just want to dump attributes into columns regardless like

PartType - Node - Port - Channel - atrribute 1 - atrribute 2 - arribute 3

in the way of php i would do something like this.

$attrib=array();

get db results

// if atrribute is not blank set atrribute array
if(!empty($Speed)){$arrib[]=Speed-value;}
if(!empty($Direction)){$arrib[]=Direction-value;}
if(!empty($Height)){$arrib[]=Height-value;}
ect.....

so if speed is not empty speed value would be $arrib[0]

PartType - Node - Port - Channel - arrib[0] - arrib[1] - arrib[2]


tables setup

table1 - part type id
PartType
Node
Port
Channel


table2 - part type attributes
PartType
Speed
Direction
Height
Length
Width
Height
Mass
Volume
Reply With Quote  
All times are GMT -4. The time now is 3:24 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC