Jump to content


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

  • Please log in to reply
2 replies to this topic

#1 dmacman

  • Members
  • PipPipPip
  • Advanced Member
  • 39 posts

Posted 21 July 2006 - 12:12 PM

Hi All,

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

$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";

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 ...

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>';
echo 'u do NOT have mssql installed<br><br>';


...and I get

Okay, fn is there
MSSQL is Loaded
MSQL is Loaded

u have mssql installed


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

I am stumped???

Anyone see this before?



#2 wildteen88

  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 21 July 2006 - 02:29 PM

What does this produce:
echo '<pre>' . print_r(get_loaded_extensions(), true) . '</pre>';
Is mssql or msql listed in the result from that code. If it is, then is a strange!

#3 dmacman

  • Members
  • PipPipPip
  • Advanced Member
  • 39 posts

Posted 21 July 2006 - 02:36 PM

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.


I hope this helps someone else.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users