Hi
I'm using the following code in a part of a script.
$sth->execute ();
my $count = 0;
while (my $ref = $sth->fetchrow_hashref ())
{
if ($q::toggle_status) {
$sthisle = $dbh->prepare("UPDATE $DB_MYSQL_NAME SET islive = 'In Progress' WHERE id = '$res_id'");
$sthisle->execute();
$sthisle->finish;
}
...
What I'd like to avoid is to open up another connection to the database. Is there a way I can set the part shown in red on the same database connection as the call above it? Or would that mess up my threads? And if I can do this ... how?
Thanks.
- wil
I'm using the following code in a part of a script.
Code:
$sth = $dbh->prepare("SELECT * FROM $DB_MYSQL_NAME WHERE res_type = 'Online' ORDER BY id"); $sth->execute ();
my $count = 0;
while (my $ref = $sth->fetchrow_hashref ())
{
if ($q::toggle_status) {
$sthisle = $dbh->prepare("UPDATE $DB_MYSQL_NAME SET islive = 'In Progress' WHERE id = '$res_id'");
$sthisle->execute();
$sthisle->finish;
}
...
What I'd like to avoid is to open up another connection to the database. Is there a way I can set the part shown in red on the same database connection as the call above it? Or would that mess up my threads? And if I can do this ... how?
Thanks.
- wil