NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Call to Undefined Function mysql_connect()


Joined: 27 Mar 2009
Posts: 3
Reply with quote
Hi,

I am trying to connect to MS SQL server via mssql_connect

If I run the code direct (through a browser) the code seems to connect OK. If I run it in PhpED I get Call to Undefined Function. Can anyone suggest what I'm doing wrong?

Thanks

mikewhite
View user's profileFind all posts by mikewhiteSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
I get Call to Undefined Function. Can anyone suggest what I'm doing wrong?


mysql_connect is not a core php function. It comes with php_mysql.dll php extension and this extension is enabled in the php distributed with PhpED.
Seems you've turned this module off in php.ini or your system is somehow broken. Run phpinfo() and check path to php.ini file, then open this file in an editor and make sure that extensoin=php_mysql.dll is not commented out. If it's not commented, check if libmysql.dll is NOT in system32 directory. If you have an incompatible libmysql.dll in system %PATH%, the php extension may fail to load.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 27 Mar 2009
Posts: 3
Reply with quote
dmitri,

thanks for replying. I can do mysql no problem with this install. It is Microsft SQL Server that I'm having problems with!

Mike
View user's profileFind all posts by mikewhiteSend private message


Joined: 27 Mar 2009
Posts: 3
Reply with quote
Hi again,

for anyone out there that has the same problem, I found an answer that fixed this for me:

in the folders

\Program Files\NuSphere\PhpED\php
and
E:\Program Files\NuSphere\PhpED\php5

are local copies of php.ini. These need the extension enabled as well as the main \php\php.ini file.
It looks as though the local copies are created when PhpED is installed and then may get out of date?

Mike
View user's profileFind all posts by mikewhiteSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
Your explanation is fully correct, but perhaps a tad more info on the whole thing:

PhpED includes php 4 and 5 distributions for use with the internal SRV server, which allows you to execute/debug php scripts without other dependencies.
These are pretty much stock php distros except that they have been configured to support debugging.
Any non-standard-enabled extension needs to be enabled manually and again after each PhpED upgrade.

This is different if you are using a 3rd party server (like apache): you need to enable the extension in the ini file for the PHP version you installed yourself.
In this case the included PHP versions don't play a role.
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Call to Undefined Function mysql_connect()
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic