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.
Expand|Select|Wrap|Line Numbers
- 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;");