DBI: Is there an "unbind" method?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BeemerBiker
    New Member
    • Jul 2008
    • 87

    DBI: Is there an "unbind" method?

    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.

    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;");
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    The place to look is in the DBI modules documentation. Personally I don't know if there is or isn't.

    Comment

    Working...