SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict y_oda2002's Avatar
    Join Date
    May 2005
    0 Post(s)
    0 Thread(s)

    Slow nonlocal db connection in php script

    Hi everyone,

    I am connecting to a non local database...
    I have a script that uses mysql and connects to the non local database in order to synchronize the local pc's database with the main system...
    However, unless we are on the local network the mysql connections seem to be extremely slow and they never complete. The script ends up timing out...
    We currently have aroun 1700 records that are updated... Sometimes the 10 queries are sent to the main system and sometimes 1500 are but never all of them... I was wondering if there is a better way to update the system... Does anyone have any experience with this sort of thing? I was thinking of writing all the queries to a sql file and using php to ftp the file to the main system.. Then have a cron script on the main site check for and read the file if it exists...

    Would that be a better way to do it?


    Nicholas Rhodes
    Asgard Development

  2. #2
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    7 Post(s)
    1 Thread(s)
    You could export the entire database (using the command line mysqldump command), ftp it somewhere where it'll be picked up and imported? This'd be quite a tricky task to write, but once it's done you'd never need to look at it again!


Posting Permissions

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