473,396 Members | 1,758 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,396 software developers and data experts.

mysql_connect Error

Hi,

I am new to php and I'm testing php connectivity to mysql. I created a
php script using the php.net sample. The script uses the mysql_connect
method and when I execute it I get the error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/testPHP/testMysql.php on line 7

I have mysqld ver 4.0.20 and php 4.2.2 that came bundled with apache
(that came bundled with RH9).

Thanks for the help,

-Rex
Jul 17 '05 #1
7 2653
>I am new to php and I'm testing php connectivity to mysql. I created a
php script using the php.net sample. The script uses the mysql_connect
method and when I execute it I get the error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/testPHP/testMysql.php on line 7

I have mysqld ver 4.0.20 and php 4.2.2 that came bundled with apache
(that came bundled with RH9).


Not all configurations of PHP support Oracle. Or Postgresql. Or
MySQL. It looks like your version doesn't. Check the output of
phpinfo() to see how your PHP is configured. You may need to build
the configuration you need or find a binary distribution that has
what you need already configured in.

Gordon L. Burditt
Jul 17 '05 #2
"Frogman" <rf*@rocketmail.com> wrote in message
news:d7**************************@posting.google.c om...
Hi,

I am new to php and I'm testing php connectivity to mysql. I created a
php script using the php.net sample. The script uses the mysql_connect
method and when I execute it I get the error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/testPHP/testMysql.php on line 7

I have mysqld ver 4.0.20 and php 4.2.2 that came bundled with apache
(that came bundled with RH9).


I had that configuration at one time. There is an RPM (or 2) you need to
download and install from RedHat that provides the MySQL connectivity. I
don't remember what it was.

I eventually wanted to upgrade my PHP to get the newer GD functions. Sad to
discover that getting PHP upgraded via the RPM route was like pulling teeth.
Too many dependencies from where you are now. I finally just installed
Fedora Core 1 and it resolved all my issues. Then, I noticed that the Update
mechanism in Fedora Core 1 indicated that a newer version of PHP was
available and I ran the update. It went smoothly.

- Virgil
Jul 17 '05 #3
Yes you're absolutely right. I tried upgrading my PHP with the latest
RPM and the dependencies goes on and on. I'm planning on just
installing Fed core 2 on my RH9 install.

Did you install Fedora on top of RH?

-Ray

"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message news:<4C*****************@newssvr23.news.prodigy.c om>...
"Frogman" <rf*@rocketmail.com> wrote in message
news:d7**************************@posting.google.c om...
Hi,

I am new to php and I'm testing php connectivity to mysql. I created a
php script using the php.net sample. The script uses the mysql_connect
method and when I execute it I get the error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/testPHP/testMysql.php on line 7

I have mysqld ver 4.0.20 and php 4.2.2 that came bundled with apache
(that came bundled with RH9).


I had that configuration at one time. There is an RPM (or 2) you need to
download and install from RedHat that provides the MySQL connectivity. I
don't remember what it was.

I eventually wanted to upgrade my PHP to get the newer GD functions. Sad to
discover that getting PHP upgraded via the RPM route was like pulling teeth.
Too many dependencies from where you are now. I finally just installed
Fedora Core 1 and it resolved all my issues. Then, I noticed that the Update
mechanism in Fedora Core 1 indicated that a newer version of PHP was
available and I ran the update. It went smoothly.

- Virgil

Jul 17 '05 #4
On 25 Jun 2004 09:02:38 -0700, rf*@rocketmail.com (Frogman) wrote:
Yes you're absolutely right. I tried upgrading my PHP with the latest
RPM and the dependencies goes on and on. I'm planning on just
installing Fed core 2 on my RH9 install.
If you don't mind taking the extra time, you should compile everything
you want to use (apache, php, mysql, ssl etc) from the source.

It's worth it. Especially at upgrade time.
Did you install Fedora on top of RH?

That'd be a bad idea. Security issues alone make a fresh install the
best install.
Oh, and could you please not top post? Thx. :)
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://www.databasix.com
================================================== =========================
Jul 17 '05 #5

"Frogman" <rf*@rocketmail.com> wrote in message
news:d7************************@posting.google.com ...
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message

news:<4C*****************@newssvr23.news.prodigy.c om>...
"Frogman" <rf*@rocketmail.com> wrote in message
news:d7**************************@posting.google.c om...
Hi,

I am new to php and I'm testing php connectivity to mysql. I created a
php script using the php.net sample. The script uses the mysql_connect
method and when I execute it I get the error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/testPHP/testMysql.php on line 7

I have mysqld ver 4.0.20 and php 4.2.2 that came bundled with apache
(that came bundled with RH9).


I had that configuration at one time. There is an RPM (or 2) you need to
download and install from RedHat that provides the MySQL connectivity. I
don't remember what it was.

I eventually wanted to upgrade my PHP to get the newer GD functions. Sad to discover that getting PHP upgraded via the RPM route was like pulling teeth. Too many dependencies from where you are now. I finally just installed
Fedora Core 1 and it resolved all my issues. Then, I noticed that the Update mechanism in Fedora Core 1 indicated that a newer version of PHP was
available and I ran the update. It went smoothly.

- Virgil

Yes you're absolutely right. I tried upgrading my PHP with the latest
RPM and the dependencies goes on and on. I'm planning on just
installing Fed core 2 on my RH9 install.

Did you install Fedora on top of RH?

-Ray


As I recall, I did indeed install Fedora 1 over RH9. It's my local box and
is only for playing, so I just took the quickest route. I had other things
to do at the moment.

- Virgil

Jul 17 '05 #6
Sorry but I'm not sure what you mean by 'top post'. Can you explain. Thanks.

Gary L. Burnore <gb******@databasix.com> wrote in message news:<cb**********@blackhelicopter.databasix.com>. ..
On 25 Jun 2004 09:02:38 -0700, rf*@rocketmail.com (Frogman) wrote:
Yes you're absolutely right. I tried upgrading my PHP with the latest
RPM and the dependencies goes on and on. I'm planning on just
installing Fed core 2 on my RH9 install.


If you don't mind taking the extra time, you should compile everything
you want to use (apache, php, mysql, ssl etc) from the source.

It's worth it. Especially at upgrade time.
Did you install Fedora on top of RH?

That'd be a bad idea. Security issues alone make a fresh install the
best install.
Oh, and could you please not top post? Thx. :)
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://www.databasix.com
================================================== =========================

Jul 17 '05 #7
In article <d7**************************@posting.google.com >, Frogman wrote:
Sorry but I'm not sure what you mean by 'top post'. Can you explain. Thanks.


So i did a little websearch.... typed in "top post" at
http://www.google.com *bam* got the answer.
--
Tim Van Wassenhove <http://home.mysth.be/~timvw>
Jul 17 '05 #8

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: Frobinrobin | last post by:
I am running Win2k3 Server and when I try to use the mysql_connect function I am getting an error: Fatal error: Call to undefined function mysql_connect() in...
2
by: Sugapablo | last post by:
I have a small test script connecting to a MySQL database. It seems to work, unless I try to use the resource link identifier returned by mysql_connect(); This works and returns all the rows in...
1
by: ezmiller | last post by:
Hi, I am very new to php, and I am trying to use it to access a mysql database. But I'm trying to use mysql_connect but the browser returns the following error sayin that the mysql_connect...
7
by: avenpace | last post by:
Hi, I got error when using mysql_connect function in my php script. If i set the db host to localhost, it give me that error altough all the user and password that I wrote is true(I can login...
6
by: GD | last post by:
Hi All, I've got MySQL 5.0.21 running on Windows Server 2003, and php running on Apache on a Linux box (Fedora Core 4). Previously when the pages were running on an IIS server the connection...
1
by: hugo | last post by:
Hello people, There is a problem is that mysql_connect() somehow caches last sessions IP and is not using the one which you put into host place. Has anyone made mysql_connect() from php to...
7
by: criveraf | last post by:
Hi there, I wasn't sure where to put this question, since it deals with both PHP and MySQL. I apologize if this is not the correct forum for this. I am working with a simple PHP application...
2
by: Ralf Seliger | last post by:
Hi, I hope someone here has a clue as to what is going on since I am completely baffled by the following: I'm working with a PHP/MySQL-web application called Moodle. When this application is...
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
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.