via PHP to Microsoft SQL Server V7.0

James Cameron james.cameron at compaq.com
Mon Jan 17 19:48:42 EST 2000


Brian Bruns wrote:
> Can you provide a bit more info about your environment...What your
> $SYBASE var is set to, a copy of the interfaces file entry, etc... also
> does it run ok when using an IP address instead of a hostname?

This may be my problem.  I have no idea what this SYBASE environment
variable is for, nor why I should have an interfaces file.

Can you tell me what I should set these to?  Or point to documentation
that explains them?

I had assumed that I need only place the DNS host name or IP address
into the sybase_connect() call in PHP.

<?php
        $link = sybase_connect("10.0.0.2","user","pass");
        if ($link == 0) {
                echo "sybase_connect failed\n";
                exit;
        }
        printf("link=%d\n", $link);
        $result = sybase_query("select * from tables", $link);
        while($row = sybase_fetch_row($result)) {
                echo "<hr>".stripslashes($row[0])."\n";
        }
        sybase_free_result($result);
        $status = sybase_close($link);
?>

-- 
James Cameron                                      (cameron at stl.dec.com)



More information about the FreeTDS mailing list