/    Sign up×
Community /Pin to ProfileBookmark

Two connections to same database from single domain

I have a CMS website built with codeigniter. In that site i have a blogging section which is using WordPress

codeigniter connects to MySQL using its class and WordPress connects using its class

site is hosted in shared hosting with godaddy.

connection to database breaks in between browsing sometimes WordPress connects to database and sometimes the codeigniter, but using phpmyadmin i can always connect.

i contacted the server people and they said its not their problem since i am able to connect using phpmyadmin

can somebody share some information on the same.

thanks

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@BelrickJul 04.2012 — is one or both using a persistant connection but each is using different login details?

...

Actually thinking about it

Seems likely that each one is over writting the others classes. Say they construct the class then store the object in a session thats being over ridden? Or only establish a persistant connection on construct.

The issue is definately not with SQL.

IMHO
Copy linkTweet thisAlerts:
@NogDogJul 04.2012 — Unless you are somehow invoking WordPress from within your CI application (or vice versa), it should not matter. If either or both are using persistent connections via mysql_pconnect(), I would recommend changing them to use the regular, non-persistent mysql_connect(), as persistent connections have a tendency to eat up DB processes instead of the expected saving of processes, unless everything about your application and DB environment and configuration is just so.
Copy linkTweet thisAlerts:
@salimauthorJul 05.2012 — Thanks NogDog and Belrick

it worked fine
×

Success!

Help @salim spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...