Skip to Content.
Sympa Menu

freetds - via PHP to Microsoft SQL Server V7.0

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: James Cameron <james.cameron AT compaq.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: via PHP to Microsoft SQL Server V7.0
  • Date: Mon, 17 Jan 2000 17:10:51 +1100


I'm struggling to get php working with freetds to query a Microsoft SQL
Server ... has anyone done this recently? Is it doable? Can anyone
point at example php scripts?

Problem: when running php against a script that tries to connect to the
database, an strace shows that a name server lookup is made for a host
"\0ctual", a null length string. The host set in the call was "actual";
the first letter is overwritten. The null host is not resolved and so
the sybase_connect() call fails.

When running it within gdb, however, the host name is not corrupted and
the connection request is sent out on the 'net.

If the network is disconnected, and the php script is run without gdb,
it pauses on the name server lookup. Activating gdb against the running
process (gdb `which php` $pid) shows the host name is again corrupt.

It appears the change to the host name is occuring within freetds's
dblib/dblic.c code.

Configuration: Red Hat V5.2, php-3.0.14, freetds-0.50.

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

http://www.opensource.org/ http://vanilla.us.netrek.org/ http://lwn.net/




Archive powered by MHonArc 2.6.24.

Top of Page