I added a temporary column to a database and want to delete it after I am finished with it. However, I cannot remove the column while it is still bound to a variable.
I tried $sth->finish() but that didnt do anything
$dbh->disconnect() works but I have to reconnect before I can remove the column. Google seems to indicate there is no unbind. The following code snippet works. Note: TestSource("NEW ") does a connect to the "new" database and assignes $dbh.
I tried $sth->finish() but that didnt do anything
$dbh->disconnect() works but I have to reconnect before I can remove the column. Google seems to indicate there is no unbind. The following code snippet works. Note: TestSource("NEW ") does a connect to the "new" database and assignes $dbh.
Code:
TestSource("NEW");
$sth = training::RunSql($dbh, "SELECT [Employee ID],TempDept, TempPrivilege FROM EmployeeInfo;");
$sth->bind_columns(\$eid, \$dept, \$priv);
while($sth->fetch())
{
...blah blah blah...
}
$dbh->disconnect();
TestSource("NEW");
training::RunSql($dbh,"ALTER TABLE EmployeeInfo DROP COLUMN TempDept;");
training::RunSql($dbh,"ALTER TABLE EmployeeInfo DROP COLUMN TempPrivilege;");
Comment