|
no_mac_jack -> RE: hiding blank fields on database result table. (8/10/2002 15:16:40)
|
Ahhhh...it makes sense now. [:D] I think, like keith said, you may want to redesign your table(s). A simple book on database normalization might help. Basically, you want to ' normalize' the database so that there is little or no repeated data. For example, rather than writing out the peoples' names for each record (like you have it now), you would make a separate table for customers (they may not be customers in your case, but it' s just an example). The table could be as simple as this... Table Name: customers Fields: - cust_ID autoNumber Primary Key - firstName - lastName Then, let' s say you have a parts order form. Just for this example, we' ll say that they can only order one part per order. So, you make an orders table... Table Name: part_orders Fields: - order_ID autoNumber Primary Key - cust_ID - partNumber So now you' ve got cust_ID representing all of the customer' s data. This saves you fom the problem of them changing their name or info. after they' ve already made some orders in the databse (which would wreak havoc on everything). I can' t explain this nearly as well as a good book, so maybe just check your local library and take a quick look at some of the books. It will really help. With this kind of setup, you can pull all of the info together for display with some sort of SQL join. Here' s one way of combining the customer data with order data... SELECT cust.firstName, cust.lastName, part_orders.partNumber FROM customsers AS cust, part_orders WHERE cust.cust_ID = part_orders.part_ID Sorry to ramble, but I think a database re-design would really help avoid predicaments like this. In an ideal database, all of those 10 fields that people add in your case would be records in a seperate table. Well, I' m not sure what that does for you. I need to go rest my weary fingers now. [:p] Good luck with whatever you decide on! Again, sorry to go a little overboard. [:(] ~no_mac_jack
|
|
|
|