Jump to content

[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
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.