473,385 Members | 1,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

undefined function mysql_connect

I know this question has come up before (I found lots of sites discussing
it), but I just can't get it to work.

I have PHP 5.0.4 and MySQL 5.0.16 (community edition). PHP runs under MS
IIS 5.1 (XP Pro SP2). Independently, both PHP and MySQL run fine (other
php pages work fine, and I can access mysql tables through jdbc), but when
I try to query a database from PHP, I get the infamous "Call to undefined
function mysql_connect()" error.

I have uncommented "extension=php_mysql.dll" in php.ini in G:\php\, which
in turn is mentioned in the Windows PATH. I have also made sure the
libmysql.dll and php_mysql.dll files are in the same G:\php\ directory.

What am I missing here?

TIA,
zero
Nov 22 '05 #1
5 2455
MeV
Can't speak to a Windows implementation, but on UNIX, unless you've
built (as in compiled from source) with MySQL support, the mysql
functions aren't part of the php program.

What does the output of phpinfo(); show on a web page or php -i in a
command shell show? If it doesn't list mysql, you'll have to rebuild
it.

Nov 22 '05 #2
"MeV" <mi************@gmail.com> wrote in news:1132692640.744248.199900
@g14g2000cwa.googlegroups.com:
Can't speak to a Windows implementation, but on UNIX, unless you've
built (as in compiled from source) with MySQL support, the mysql
functions aren't part of the php program.

What does the output of phpinfo(); show on a web page or php -i in a
command shell show? If it doesn't list mysql, you'll have to rebuild
it.


As I understand it, on windows there is no need to recompile. All
extension libraries are loaded dynamically on startup, by loading the dlls
mentioned in php.ini

At least, that's how I understand it. But obviously I'm missing something,
since it's not loading the mysql library.
Nov 23 '05 #3
zero wrote:
I know this question has come up before (I found lots of sites discussing
it), but I just can't get it to work.

I have PHP 5.0.4 and MySQL 5.0.16 (community edition). PHP runs under MS
IIS 5.1 (XP Pro SP2). Independently, both PHP and MySQL run fine (other
php pages work fine, and I can access mysql tables through jdbc), but when
I try to query a database from PHP, I get the infamous "Call to undefined
function mysql_connect()" error.

I have uncommented "extension=php_mysql.dll" in php.ini in G:\php\, which
in turn is mentioned in the Windows PATH. I have also made sure the
libmysql.dll and php_mysql.dll files are in the same G:\php\ directory.

What am I missing here?

TIA,
zero


You did stop and start the web server, right?

What does phpinfo() show?

Look for the mssql extensions to see if they are loaded.

Also, which php.ini is it using? Is it the one you changed?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 23 '05 #4
Jerry Stuckle <js*******@attglobal.net> wrote in
news:et********************@comcast.com:
zero wrote:
I know this question has come up before (I found lots of sites
discussing it), but I just can't get it to work.

I have PHP 5.0.4 and MySQL 5.0.16 (community edition). PHP runs
under MS IIS 5.1 (XP Pro SP2). Independently, both PHP and MySQL run
fine (other php pages work fine, and I can access mysql tables
through jdbc), but when I try to query a database from PHP, I get the
infamous "Call to undefined function mysql_connect()" error.

I have uncommented "extension=php_mysql.dll" in php.ini in G:\php\,
which in turn is mentioned in the Windows PATH. I have also made
sure the libmysql.dll and php_mysql.dll files are in the same G:\php\
directory.

What am I missing here?

TIA,
zero


You did stop and start the web server, right?

What does phpinfo() show?

Look for the mssql extensions to see if they are loaded.

Also, which php.ini is it using? Is it the one you changed?


It was indeed using the wrong php.ini. I changed the path in the registry,
and now it works :-)

Thanks!
Nov 23 '05 #5
zero wrote:
I know this question has come up before (I found lots of sites discussing
it), but I just can't get it to work.

I have PHP 5.0.4 and MySQL 5.0.16 (community edition). PHP runs under MS
IIS 5.1 (XP Pro SP2). Independently, both PHP and MySQL run fine (other
php pages work fine, and I can access mysql tables through jdbc), but when
I try to query a database from PHP, I get the infamous "Call to undefined
function mysql_connect()" error.

I have uncommented "extension=php_mysql.dll" in php.ini in G:\php\, which
in turn is mentioned in the Windows PATH. I have also made sure the
libmysql.dll and php_mysql.dll files are in the same G:\php\ directory.

What am I missing here?

TIA,
zero

What do you have extension_dir set to?
It should point to the ext directory (G:\php\ext)

-david-

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: BT | last post by:
Hi .. a newbie question. I get the following error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/index.php on line 3. I have the following RPMS installed on RH7.2...
2
by: Chris Allen | last post by:
Hi, I'm (slowly) trying to get to grips with PHP and MySQL. I'm running: Red Hat 7.2 Apache 1.3.20 Mysql 3.32.41 PHP 4.1.2 A simple connect
4
by: gc | last post by:
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have seen this before. I'm teaching myself PHP/MySQL and trying to setup a guestbook. I'm running latest versions of Apache, PHP and...
5
by: Grant Nosbush | last post by:
I have searched the newsgroups and the web trying to solve this problem and just can't get it. Maybe someone will be able to help. I am getting the following error when I try to view a test page...
4
by: John Oliver | last post by:
PHP Notice: Undefined index: name in /home/www/reformcagunlaws.com/new.php on line 6 PHP Notice: Undefined index: address in /home/www/reformcagunlaws.com/new.php on line 7 PHP Notice: ...
5
by: awdsites | last post by:
Hi, I'm a noob with a server so keep that in mind :) Been trying to connect with php to mysql and all I get is: "Fatal error: Call to undefined function: mysql_connect()" I've read and read...
0
by: java | last post by:
Hi there! After I overcame some short_open_tag (thanks, Rik!) I encounter another strange php-behaviour. The script I just got to work on the windows-commandline obviously does as php.ini tells...
8
by: seni786 | last post by:
Hi i am having problems with some code that i wrote out for a shopping cart. the shopping cart it self works when a product is added but when the 'CART CONTENT' button is clicked on it comes up...
7
by: lumo2000 | last post by:
hello i am not able to get mysql running. you can get my server/php settings/details here: http://damn-i-have.no-ip.com/phpinfo.php i already enabled the following stuff in my php.ini NOTE:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.