Skip to Content.
Sympa Menu

freetds - Re: [freetds] Windows Question

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Patrick Corbett" <pcorbe81 AT maine.edu>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Windows Question
  • Date: Mon, 16 Apr 2007 09:39:02 -0600

Why is freetds.conf necessary? Why can't it simply rely on PHP to make the
connection to the DB as one already has to?

I've tried several combinations and no luck so far... I am aware of the
escaping and the need for double backslashes in PHP... I have my script
working with php_mssql.dll. My file monitor (MS's File Monitor) shows that
php_dblib.dll is being opened and soon after freetds.conf is being open. I
made a folder writeable for the process that executes php_dblib.dll, but no
log file is ever created... I even created the file and gave it all
permissions, but still nothing (also tried dump file append).

I haven't used PHP CLI much, is there a standard test someone could suggest
that would help narrow down the possibilities?

I'm sure there's something wrong on my end, just not sure what yet...

Thanks,

Patrick

On 4/16/07, ZIGLIO, Frediano, VF-IT <Frediano.Ziglio AT vodafone.com> wrote:

>
> Patrick Corbett wrote:
> > I reference it in my PHP connection string the following
> > way:
> >
> > $host = "server\instance";
> > mssql_connect($host, $user, $pass);
> >
> > So... the question is can I use named instances...?
>
> As stated previously, you can use the "instance" entry in
> freetds.conf.
> That's one way.
>
> I'm pretty sure you can use "instance\servername" with any FreeTDS
> library. I know Frediano added it for ODBC
> (http://www.freetds.org/userguide/odbcconnattr.htm) but istr it works
> everywhere. I don't have a server to test with, but you
> could try bsqldb.
> If it connects, PHP should be able to, too.
>

No, this was implemented directly on ODBC. Current CVS have similar
option for libTDS (see parse_server_name_for_port in src/tds/config.c).

> Take care to escape the '\' character if need be. In your
> example above,
> you use double quotes. The PHP manual
> (http://www.php.net/manual/en/language.types.string.php) says the
> backslash needs to be escaped in double-quoted strings:
>
> $host = "server\\instance";
> mssql_connect($host, $user, $pass);
> or
> $host = 'server\instance';
> mssql_connect($host, $user, $pass);
>
> Tell us how it works out. I might need to add something to the User
> Guide.
>

I think so... however I cannot find specifications even for server:port
syntax... this is a useful extension but not that documented.

freddy77

_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page