Groups > Novell > Novell NetWare with PHP > Re: PHP Fatal error: Call to undefined function mssql_connect()




PHP Fatal error: Call to undefined function mssql_connect()
in sys:/php5/scripts/1connect.php

PHP Fatal error: Call to undefined function mssql_connect() in sys:/php5/scripts/1connect.php
Tue, 19 Sep 2006 19:52:09 GMT
Here is my variables..

$myServer = "193.168.1.170";
$myUser = "user"; // SQL authentication but have also try with windows

authentication
$myPass = "password"; // SQL authentication but have also try with 
windows authentication
$myDB = "msdatabase";

Any ideas why I keep getting "Call to undefined function 
mssql_connect()" error at my called to connect to mssql database?

$dbhandle = mssql_connect($myServer, $myUser, $myPass) or die("Couldn't 
connect to SQL Server on $myServer");

If you have experience this problem before please be kind enough to help 
me get pass along your solution. I am running a php5.0.5 with apache 
2.0.54 on netware 6.5 sp5 and trying to connect to MSSQL database 
Post Reply
Re: PHP Fatal error: Call to undefined function mssql_connect() in sys:/php5/scripts/1connect.php at this line
Tue, 19 Sep 2006 22:37:47 GMT
Hi Mike,

Mike <bpiorec@netscape.net> wrote in news:JTXPg.185$0w1.180@prv-
forum2.provo.novell.com:

> Here is my variables..
> 
> $myServer = "193.168.1.170";
> $myUser = "user"; // SQL authentication but have also try with
windows 
> authentication
> $myPass = "password"; // SQL authentication but have also try
with 
> windows authentication
> $myDB = "msdatabase";
> 
> Any ideas why I keep getting "Call to undefined function 
> mssql_connect()" error at my called to connect to mssql database?
because you dont have the proper extension loaded.

> $dbhandle = mssql_connect($myServer, $myUser, $myPass) or
die("Couldn't 
> connect to SQL Server on $myServer");
> 
> If you have experience this problem before please be kind enough to help 
> me get pass along your solution. I am running a php5.0.5 with apache 
> 2.0.54 on netware 6.5 sp5 and trying to connect to MSSQL database 
> residing on Windows 2003 Server. Thanks!
you need to either load the mssql or the odbtp extension in order to 
connect to the MSSQL server. The mssql extension uses the freetds library, 
and I guess I have somewhere a problem in my port cause I didnt succeed yet 
with connecting. So if you need something _now_ then you can only take 
odbtp which works great; for that you have to replace the whole Novell PHP5 
distro with mine cause it lacks of exports from php5lib.nlm. Best you 
unload all Apache instances, then rename sys:/php5 to sys:/php5.nov; then 
extract my latest complete build (scroll down for latest!) to a temporary 
place:
http://www.gknw.de/phpbb/viewtopic.php?t=214
and copy the new ./php5 folder to your sys: volume; then edit php.ini and 
add the extensions you need...
got the complete odbtp package from SF:
http://odbtp.sf.net/
install the win32 service on the win32 machine and configure odbtp;
use the odbtp extension which comes with the PHP5 archive - not one from 
Sourceforge!
If you have time to play with then try the freetds stuff, and mssql ext:
http://www.gknw.net/mirror/freetds/

Guenter.
Post Reply
Re: PHP Fatal error: Call to undefined function mssql_connect()
Tue, 19 Sep 2006 23:31:37 GMT
Mike wrote:
> Here is my variables..
> 
> $myServer = "193.168.1.170";
> $myUser = "user"; // SQL authentication but have also try with
windows 
> authentication
> $myPass = "password"; // SQL authentication but have also try
with 
> windows authentication
> $myDB = "msdatabase";
> 
> Any ideas why I keep getting "Call to undefined function 
> mssql_connect()" error at my called to connect to mssql database?
> 
> $dbhandle = mssql_connect($myServer, $myUser, $myPass) or
die("Couldn't 
> connect to SQL Server on $myServer");
> 
> If you have experience this problem before please be kind enough to help 
> me get pass along your solution. I am running a php5.0.5 with apache 
> 2.0.54 on netware 6.5 sp5 and trying to connect to MSSQL database 
> residing on Windows 2003 Server. Thanks!

We had a similar problem when a while ago when we upgraded to php 5.0.5 
and also the server upgrade to NW65sp5 CPR

In the end the best option was to use mysqli rather than mysql commands. 
  The following will hopefully clarify this:

...
$dbname = "dbname";
$dbuser = "dbuser";
$dbpassword = "dbpass";
$dbserver ="localhost";
$dbtable1 ="administration";

//connecting to MySQL database
$connect = mysqli_connect($dbserver, $dbuser, $dbpassword, $dbname) or 
die("<font color=red><b>Could not connect to MySQL
database</b></font>");

//select database to read from
mysqli_select_db($connect, $dbname) or die("<font
color=red><b>Could not 
select database</b></font>");

$query1 = "select * from $dbtable1 order by id"

$result1 = mysqli_query($connect, $query1);

etc..

Also check that the correct extension is being loaded by apache as SP5 
seems to revert to the php4 extension

HTH

Post Reply
Re: PHP Fatal error: Call to undefined function mssql_connect()
Wed, 20 Sep 2006 19:35:39 GMT
Guenter wrote:
> Hi Mike,
> 
> Mike <bpiorec@netscape.net> wrote in news:JTXPg.185$0w1.180@prv-
> forum2.provo.novell.com:
> 
>> Here is my variables..
>>
>> $myServer = "193.168.1.170";
>> $myUser = "user"; // SQL authentication but have also try
with windows 
>> authentication
>> $myPass = "password"; // SQL authentication but have also try
with 
>> windows authentication
>> $myDB = "msdatabase";
>>
>> Any ideas why I keep getting "Call to undefined function 
>> mssql_connect()" error at my called to connect to mssql database?
> because you dont have the proper extension loaded.
> 
>> $dbhandle = mssql_connect($myServer, $myUser, $myPass) or
die("Couldn't 
>> connect to SQL Server on $myServer");
>>
>> If you have experience this problem before please be kind enough to
help 
>> me get pass along your solution. I am running a php5.0.5 with apache 
>> 2.0.54 on netware 6.5 sp5 and trying to connect to MSSQL database 
>> residing on Windows 2003 Server. Thanks!
> you need to either load the mssql or the odbtp extension in order to 
> connect to the MSSQL server. The mssql extension uses the freetds library,

> and I guess I have somewhere a problem in my port cause I didnt succeed yet

> with connecting. So if you need something _now_ then you can only take 
> odbtp which works great; for that you have to replace the whole Novell PHP5

> distro with mine cause it lacks of exports from php5lib.nlm. Best you 
> unload all Apache instances, then rename sys:/php5 to sys:/php5.nov; then 
> extract my latest complete build (scroll down for latest!) to a temporary 
> place:
> http://www.gknw.de/phpbb/viewtopic.php?t=214
> and copy the new ./php5 folder to your sys: volume; then edit php.ini and 
> add the extensions you need...
> got the complete odbtp package from SF:
> http://odbtp.sf.net/
> install the win32 service on the win32 machine and configure odbtp;
> use the odbtp extension which comes with the PHP5 archive - not one from 
> Sourceforge!
> If you have time to play with then try the freetds stuff, and mssql ext:
> http://www.gknw.net/mirror/freetds/
> 
> Guenter.
> 
Guenter,

I tried your suggestion and still get the error. Here are my steps:
1) I Downloaded php5.0.5_ap2-20060906173017.zip from 
http://www.gknw.de/phpbb/viewtopic.php?t=214 and extracted.
2) Unloaded Apache instances from NW6.5 and rename sys:/php5 to 
sys:/php5.nov
3) Copied the new php5 folder from php5.0.5_ap2-20060906173017 to sys: 
volume
4) I edited php.ini by adding this "extension=php_odbtp_mssql.nlm" and

"display_error=On".
5) I installed win32 service on the Windows Server and "odbtpsrv.exe"
is 
running.
6) I am not sure what you mean by "configure odbtp"? and "use the
odbtp 
extension which comes with the PHP5 Archive - not one from Sourceforge!?"

Thanks!

Post Reply
Re: PHP Fatal error: Call to undefined function mssql_connect()
Wed, 20 Sep 2006 19:38:15 GMT
Graham Clarke wrote:
> Mike wrote:
>> Here is my variables..
>>
>> $myServer = "193.168.1.170";
>> $myUser = "user"; // SQL authentication but have also try
with windows 
>> authentication
>> $myPass = "password"; // SQL authentication but have also try
with 
>> windows authentication
>> $myDB = "msdatabase";
>>
>> Any ideas why I keep getting "Call to undefined function 
>> mssql_connect()" error at my called to connect to mssql database?
>>
>> $dbhandle = mssql_connect($myServer, $myUser, $myPass) or 
>> die("Couldn't connect to SQL Server on $myServer");
>>
>> If you have experience this problem before please be kind enough to 
>> help me get pass along your solution. I am running a php5.0.5 with 
>> apache 2.0.54 on netware 6.5 sp5 and trying to connect to MSSQL 
>> database residing on Windows 2003 Server. Thanks!
> 
> We had a similar problem when a while ago when we upgraded to php 5.0.5 
> and also the server upgrade to NW65sp5 CPR
> 
> In the end the best option was to use mysqli rather than mysql commands. 
>  The following will hopefully clarify this:
> 
> ...
> $dbname = "dbname";
> $dbuser = "dbuser";
> $dbpassword = "dbpass";
> $dbserver ="localhost";
> $dbtable1 ="administration";
> 
> //connecting to MySQL database
> $connect = mysqli_connect($dbserver, $dbuser, $dbpassword, $dbname) or 
> die("<font color=red><b>Could not connect to MySQL
database</b></font>");
> 
> //select database to read from
> mysqli_select_db($connect, $dbname) or die("<font
color=red><b>Could not 
> select database</b></font>");
> 
> $query1 = "select * from $dbtable1 order by id"
> 
> $result1 = mysqli_query($connect, $query1);
> 
> etc..
> 
> Also check that the correct extension is being loaded by apache as SP5 
> seems to revert to the php4 extension
> 
> HTH
> 
> Graham
Graham,

Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact