dmacman Posted July 21, 2006 Share Posted July 21, 2006 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>';elseecho 'u do NOT have mssql installed<br><br>';phpinfo();[/code]...and I get[QUOTE]Okay, fn is there------------------MSSQL is LoadedMSQL is Loadedu have mssql installed[/QUOTE]and[QUOTE]MSSQL Support enabledActive Persistent Links 0Active Links 0Library version 7.0Directive Local Value Master Valuemssql.allow_persistent On Onmssql.batchsize 0 0mssql.compatability_mode Off Offmssql.connect_timeout 10 10mssql.datetimeconvert On Onmssql.max_links Unlimited Unlimitedmssql.max_persistent Unlimited Unlimitedmssql.max_procs Unlimited Unlimitedmssql.min_error_severity 10 10mssql.min_message_severity 10 10mssql.secure_connection Off Offmssql.textlimit Server default Server defaultmssql.textsize Server default Server defaultmssql.timeout 60 60[/QUOTE]I am stumped???Anyone see this before?Thanks,Don Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 21, 2006 Share Posted July 21, 2006 What does this produce:[code]<?phpecho '<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! Quote Link to comment Share on other sites More sharing options...
dmacman Posted July 21, 2006 Author Share Posted July 21, 2006 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.