www.webdeveloper.com
Results 1 to 4 of 4

Thread: Two connections to same database from single domain

  1. #1
    Join Date
    Jan 2007
    Posts
    47

    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

  2. #2
    Join Date
    Apr 2010
    Posts
    227
    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

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,235
    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.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Jan 2007
    Posts
    47
    Thanks NogDog and Belrick

    it worked fine

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles