/    Sign up×
Community /Pin to ProfileBookmark

Fatal error: Call to undefined function mssql_connect()

[upl-image-preview url=https://www.webdeveloper.com/forum/assets/files/2018-04-17/1523957939-526677-php-info-screenshot.png]
Hi,
I am using wampserver 2.2 which have php 5.4.3

I am trying to connect to mssql server 2008 R. but i am getting
“Fatal error: Call to undefined function mssql_connect() in C:wampwww...”

I have enabled the extension : php_mssql and restarted the server,but sto far no luck.

My machine is windows 7 with 64 bit.

I understand that there are some mssql driver for php connection that need to be installed but based on my research all of them are related to 32 bit.

Looking forward for your advise.

Regards

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@rootApr 17.2018 — 32bit is fine on a 64 bit, its the 64bit that is incompatible with 32 bit.

You may need to look at the actual system compatibility mode and switch on the appropriate compatibility needed within the operating system.

The first thing that springs to mind is this, have you checked the admin control panel and ensured that the service is running? Is it stalled, need restarting, paused??? Also you can check in the operating system if the services are enabled.

Connection errors come in a couple of main flavours and these are, typo and config. So check that you are referring to the proper connection method when opening the database, the wrong path will result in no connection because the server is referenced wrong.
Copy linkTweet thisAlerts:
@mike_bibbsApr 17.2018 — To my great surprise, this error is pretty removable on 64-bit, excellent!
Copy linkTweet thisAlerts:
@themoonauthorApr 17.2018 — Hi,

This is my db connection code:

<?php

$serverName = "vatranttran,49738"; //serverNameinstanceName, portNumber (default is 1433)

$connectionInfo = array( "Database"=>"JSAP", "UID"=>"user", "PWD"=>"pass");

$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {

echo "Connection established.<br />";

}else{

echo "Connection could not be established.<br />";

die( print_r( sqlsrv_errors(), true));

}

?>

These are the enabled extensions:

extension=php_pdo_sqlsrv_7_nts.dll


extension=php_pdo_sqlsrv_7_ts.dll


extension=php_sqlsrv_7_nts.dll


extension=php_sqlsrv_7_ts.dll

Yes, i am referring to the correct db and all services are running.

Copy linkTweet thisAlerts:
@rootApr 18.2018 — You problem is staring you in the face, in about a 24 or 28pt font that says...

PHP 5.4.3

... and you are tying to use PHP 7 type calls???

Upgrade your PHP library.
Copy linkTweet thisAlerts:
@themoonauthorApr 19.2018 — Hi Root,

i have disabled the above extensions and enabled the ones related to php version 5.4.3 and it worked fine.

Thanks a lot although i was wondering how you managed to measure the font size of this php version ... LOL.

?
Copy linkTweet thisAlerts:
@getintopcApr 19.2018 — To my extraordinary astonishment, this blunder is really removable on 64-bit, phenomenal!
Copy linkTweet thisAlerts:
@rootApr 19.2018 — @themoon#1591362 A guess-timate ?
×

Success!

Help @themoon spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...