chrish123 Posted September 10, 2008 Posted September 10, 2008 Hi, I work for a small company that have multiple shops using very heavily modified RC1 shop codebase which is duplicated and always updated (nearly a years worth of custom daily work) so I cant use the Virtual mall addon contributions... How can I view all the databases for outstanding orders from one page across all sites? Is there anything avaiable commercially or free which can do this? Is there anyway in php to connect to more than 1 osc database at a time? Any help very much appreciated! Chris
♥FWR Media Posted September 10, 2008 Posted September 10, 2008 Something like this will do it .. class multiConnect{ var $host = ''; var $user = ''; var $pass = ''; var $dbname = ''; var $link; function multiConnect(){ } function getSingleton($host, $user, $pass, $dbname){ if( false !== is_null($this->link) ){ $this->setParams($host, $user, $pass, $dbname); $this->dbGetResource(); } elseif( ($host != $this->host) || ($user != $this->user) || ($pass != $this->pass) || ($dbname != $this->dbname) ){ $this->dbDisconnect(); $this->setParams($host, $user, $pass, $dbname); $this->dbGetResource(); } else { // Use same old link } } function dbGetResource(){ $this->link = mysql_connect($this->host, $this->user, $this->pass); $this->dbConnect(); } function dbDisconnect(){ mysql_close($this->link); } function setParams($host, $user, $pass, $dbname){ $this->host = $host; $this->user = $user; $this->pass = $pass; $this->dbname = $dbname; } function dbConnect(){ mysql_select_db ($this->dbname, $this->link); } } // end multiConnect class Then do the following to choose the different databases: - $db = new multiConnect(); $db->getSingleton('localhost', 'username', 'password', 'databasename'); // Do stuff for databasename $db->getSingleton('localhost', 'username2', 'password2', 'databasename2'); // Do stuff for databasename2 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.
chrish123 Posted September 10, 2008 Author Posted September 10, 2008 Hi, Thank you very much! I'll try this out later on! I've got a semi idea of how to achieve what I want, I think I'll try to re-use the code from the admin/index.php or similar. Thanks for taking the time to write that! Kind regards Chris
satish Posted September 10, 2008 Posted September 10, 2008 create four configre files in admin. let admin select on login(from std db connected by default). Now He selects the store and a proper configure.php file will connect to the store data and display. YOu can do it by changing file name defines on store selection. else Hobzilla contribution will help You out. Satish Satish Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.