Hello,
Sorry in advance if this is a trivial problem.
I have a script which is executed about 2000 times in a row, and requires a connection to the mysql database each time it is executed.
I am wondering if there is a way to have a seperate program which connects to mysql and then keeps the connection open so that I can save some time and not have to connect 2000 times to the same thing.
I tried just making a script that connects to the database and then is put in an infinite loop, im just not sure if i can reference that connection with my other script. When i tried to execute it, it didn't know that a connection was already open. In other words I would like to reference the line:
$dbh = DBI->connect($dsn , $user, $pass);
in the script that is run 2000 times.
Any help is appreciated.
Sorry in advance if this is a trivial problem.
I have a script which is executed about 2000 times in a row, and requires a connection to the mysql database each time it is executed.
I am wondering if there is a way to have a seperate program which connects to mysql and then keeps the connection open so that I can save some time and not have to connect 2000 times to the same thing.
I tried just making a script that connects to the database and then is put in an infinite loop, im just not sure if i can reference that connection with my other script. When i tried to execute it, it didn't know that a connection was already open. In other words I would like to reference the line:
$dbh = DBI->connect($dsn , $user, $pass);
in the script that is run 2000 times.
Any help is appreciated.
Comment