glennn.php Posted July 2, 2010 Share Posted July 2, 2010 i'd love some help with a complex (for me) db layout for each registered client, i have 17 forms - Categories, each with as many as 24 values - Items, to be stored. i was advised to create a Cats table, with cat_id and cat_name, and an items table, with cat_id, item_id, and item_name, and an amounts table, with client_id, cat_id, item_id, amount ... but this seems a bit obtuse. could someone tell me if there's a simpler way to store such data? i've become a bit confused now... ) thanks much GN Quote Link to comment https://forums.phpfreaks.com/topic/206563-actually-some-help-with-a-db-layout/ Share on other sites More sharing options...
therelelogo Posted July 5, 2010 Share Posted July 5, 2010 Hi, it depends what you actually need to store, i mean... i was advised to create a Cats table, with cat_id and cat_name, and an items table, with cat_id, item_id, and item_name, and an amounts table, with client_id, cat_id, item_id, amount ... but this seems a bit obtuse. ...if you dont need them, dont have them? why so many tables? is there a way to "merge" columns from tables to make just a couple of tables? Without knowing exactly whats on your forms and how they are used i can only speculate but what about: 1 form for all your users (name, email, address etc etc) 1 form for all your users items (made_by, item_name, item_price etc etc) and whatever else (like i said not sure what else you have there) but like rather than having a seperate table for each cat (assuming thats category) just have the one table but define which cat it belongs to maybe in the second column (the first being a item_id of somesort for easy referencing) hope that is somwhat helpful Quote Link to comment https://forums.phpfreaks.com/topic/206563-actually-some-help-with-a-db-layout/#findComment-1081605 Share on other sites More sharing options...
glennn.php Posted July 6, 2010 Author Share Posted July 6, 2010 that's exactly what i thought, too. thanks, that was very helpful. i did, in fact, merge a couple of tables and this made everything much easier (and more logical)... thanks again Quote Link to comment https://forums.phpfreaks.com/topic/206563-actually-some-help-with-a-db-layout/#findComment-1081828 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.