Forums / Contribution-Writing Guidelines / what's the best way to access another database?

what's the best way to access another database?

Locked

Started by delia on 20 Apr 2010, 1:02 PM · Views: 3,422

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
20 Apr 2010, 1:02 PM
#1
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

what's the best way to access another database?

I need to pull some limited information for a dropdown list in a sidebox. This information comes from another database on the site.

I see 2 ways to go:

1 is to pull that information in a separate php script and upload it to a new table in the zen database. I thought this would be the easiest but I'm having php writer's block (dang arrays)

So the other way is doing it within the cart itself - in the module for the sidebox. I did try this but it's killing off the sideboxes that fall after it because of my inability to switch from one database connection back to the original.

So I need advice on the best way to do this and then probably some tips on how to do it!

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

3 May 2010, 1:16 PM
#2
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: what's the best way to access another database?

Since I got no answers, I wrote a script to pull the information from the extra database and inserted it into zen database and we're using a cron job to update the zen table.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

14 May 2010, 1:44 AM
#3
tiresmokindad avatar

tiresmokindad

New Zenner

Join Date:
May 2010
Posts:
11
Plugin Contributions:
0

Re: what's the best way to access another database?

Hello delia,

I think you need some expert advice for that kind of problem. I will try to look for the information about that certain kind of problem. I know some people who can manage to solve that php writer's block.