By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,117 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,117 IT Pros & Developers. It's quick & easy.

MS SQL Server Connections

P: n/a
I have Red Hat 9. Anyone here have that too and can help me?

Without having to do a lot of major surgery, such as recompiling my
PHP (which I consider risky), I want to use either unixODBC or FreeTDS
to connect RH9 Linux to MS SQL Server 2000.

I noticed from phpinfo() that FreeTDS wasn't configured into the PHP
install, although I have installed FreeTDS just now. That's probably
why the mssql_connect() call won't connect -- says Call to undefined
function. I probably need to recompile PHP (again, risky) in order to
get this to work. However, I *DID* notice that unixODBC was enabled,
so I wanted to connect with that using this code:

$dsn = "Driver={SQL Server};Server=10.22.109.5;Database=pubs";
$user = 'sa';
$pass = 'password';
$link = odbc_cconnect($dsn, $user, $pass);
$sql = 'SELECT * FROM authors';
$q = odbc_exec($link, $sql);
$rec = odbc_fetch_array($q);
echo $rec['au_lname'];
odbc_free_result($q);

Well, again, it says Call to undefined function odbc_connect().

What's the catch? Is there a simple way out of this?
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi !

On 19 Nov 2003 13:50:45 -0800, go********@hotpop.com (Google Mike)
wrote:
I have Red Hat 9. Anyone here have that too and can help me?

Without having to do a lot of major surgery, such as recompiling my
PHP (which I consider risky), I want to use either unixODBC or FreeTDS
to connect RH9 Linux to MS SQL Server 2000.
AFAIK, you canuse only extension on Linux, which are compiled in. You
can have a look at dynamically loading them.
But compiling is not risky at all.

I noticed from phpinfo() that FreeTDS wasn't configured into the PHP
install, although I have installed FreeTDS just now. That's probably
why the mssql_connect() call won't connect -- says Call to undefined
function.
The mssql extension is not loaded.
I probably need to recompile PHP (again, risky) in order to
get this to work. However, I *DID* notice that unixODBC was enabled,
so I wanted to connect with that using this code:


never tried that, so cannot quite help.

HTH, Jochen
--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.