karozans Posted June 18, 2007 Posted June 18, 2007 Hi all, I have a question for the "Programmer Gods" of osCommerce. I am a noob at php and mysql so I am not sure how to go about this. I work at a company that manufactures parts that we sell to everyone, we also manufacture other parts exclusively for many other different companies. I would like to have customer ABC create his/her account and automatically have access to ONLY the parts that my company makes for everyone. (this part is already done by osCommerce and works great). If customer ABC has my company manufacture a patented part I would like be able to show that specific part to that customer only. So that the customer can see all of my companys parts and all of ABC customers parts too. Of course ABC cannot see XYZ parts or pricing and vice versa. So my question is... What is the most elegant way to do this? I kinda have some ideas but I am not sure what the programming guru's would do. Should I create a new dbase table? How should I modify the select * from * where statements so that only the correct customers parts are shown? If someone could point me in the right direction that would be awesome. thanks
♥FWR Media Posted June 18, 2007 Posted June 18, 2007 Very basic suggestion from the limited info given (and my limited time). But perhaps create a field in "customers" called patented_id default NULL then where the query exists as you suggested SELECT * FROM * WHERE X Perhaps you could add ($result being the array).. if ($result['patented_id']) $query = "SELECT * FROM <table> WHERE X AND patented_id = $result['patented_id'] "; else $query = "SELECT * FROM <table> WHERE X"; Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
karozans Posted June 19, 2007 Author Posted June 19, 2007 awesome thanks for the tip hopefully I can do this without screwing everything up.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.