Link to home
Start Free TrialLog in
Avatar of MedtronicVascSR
MedtronicVascSRFlag for United States of America

asked on

PHP Undefined variable: odbc_close.... Fatal error: Function name must be a string....

The following code:

<table border="1">
<script language="php">
      $ds = odbc_connect("myTest", "", "");
      $shortlist = odbc_do($ds, "
            SELECT *
            FROM shortlist;
      ");
      while(odbc_fetch_row($shortlist)) {
            $lname = odbc_result($shortlist, 1);
            $fname = odbc_result($shortlist, 2);
            $email = odbc_result($shortlist, 3);
            print("
                  <tr>
                  <td>$fname</td>
                  <td>$lname</td>
                  <td>$email</td>
                  </tr>
            ");}
      $odbc_close($ds);
</script>
</table>

Gives me the following errors:
          Notice: Undefined variable: odbc_close in c:\webroot\myTest\index.php on line 26
          Fatal error: Function name must be a string in c:\webroot\myTest\index.php on line 26

If I omit odbc_close (comment it out), the code executes just fine.  But it doesn't solve the problem of the fact that the function is not performing the way I think it's supposed to.  Perhaps this is an installation issue?  I just installed PHP and am using on this machine for the first time - Windows XP Pro.


Thanks in advance!
Regards,
Carlos
ASKER CERTIFIED SOLUTION
Avatar of ldbkutty
ldbkutty
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MedtronicVascSR

ASKER

Thanks for the thoroughness of your answer Marcel - both of you were right so I will split points.
Regards,
Carlos