Jump to content

Archived

This topic is now archived and is closed to further replies.

dmacman

[Resolved]Strange"Call to undefined function mssql_connect()" mssql IS running??

Recommended Posts

Hi All,

I setup our server (PHP 5.1.4, Apache 2.058 and MS SQL 2005 server), but when I do a ...
[code]

$msconnect=mssql_connect("x","sa","x");
$msdb=mssql_select_db("x",$msconnect);
$msquery = "select FirstName,LastName,Gender from Users";
$msresults= mssql_query($msquery);
while ($row = mssql_fetch_array($msresults)) {
      echo "<li>" . $row['FirstName'] . " " . $row['LastName'] . " " . $row['Gender'] .  "</li>\n";
}
[/code]

I get "Fatal error: Call to undefined function mssql_connect()".

But I checked that php_mssql.dll (in my php.ini) is loading and running by ...

[code]
if (function_exists('mssql_connect')){
echo "Okay, fn is there<br>------------------<br>";
} else {
echo "Hmmm .. fn is not even there<br>------------------<br>";
}

if(extension_loaded("mssql")) {
echo "MSSQL is Loaded<br>";
}
else {
echo "MSSQL not loaded<br>";
}

if(extension_loaded("msql")) {
echo "MSQL is Loaded<br>";
}
else {
echo "MSQL not loaded<br>";
}
echo '<br><br>';

$ext = get_loaded_extensions();
if(in_array('mssql', $ext))
echo 'u have mssql installed<br><br>';
else
echo 'u do NOT have mssql installed<br><br>';

phpinfo();

[/code]

...and I get

[QUOTE]Okay, fn is there
------------------
MSSQL is Loaded
MSQL is Loaded


u have mssql installed[/QUOTE]

and

[QUOTE]MSSQL Support enabled
Active Persistent Links 0
Active Links 0
Library version 7.0

Directive Local Value Master Value
mssql.allow_persistent On On
mssql.batchsize 0 0
mssql.compatability_mode Off Off
mssql.connect_timeout 10 10
mssql.datetimeconvert On On
mssql.max_links Unlimited Unlimited
mssql.max_persistent Unlimited Unlimited
mssql.max_procs Unlimited Unlimited
mssql.min_error_severity 10 10
mssql.min_message_severity 10 10
mssql.secure_connection Off Off
mssql.textlimit Server default Server default
mssql.textsize Server default Server default
mssql.timeout 60 60[/QUOTE]

I am stumped???

Anyone see this before?

Thanks,

Don

Share this post


Link to post
Share on other sites
What does this produce:
[code]<?php
echo '<pre>' . print_r(get_loaded_extensions(), true) . '</pre>';
?>[/code]
Is mssql or msql listed in the result from that code. If it is, then is a strange!

Share this post


Link to post
Share on other sites
I resolved this.

I shut off apache, then copied all the files out of my php directory.

I then downloaded the zip file, not the .exe installer and placed all the files back into my php directory.

Then I put back my .htaccess files and edited the php.ini (to load the modules and set all paths like I had them for doc_root and extensions).

Restarted Apache, and my mssql_connect now works!

All the files like "ntwdblib.dll" and "php_mssql.dll" are in the same places (and they had the same creation dates) all my paths in the php.ini are the same and I have "nothing" in the win/sys32 directory.

Straaannnnngggeeee!!!!!!!!!!

I hope this helps someone else.

Don

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.