Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-09-2002, 11:53 PM   #1
Registered: Sep 2001
Location: Houston
Distribution: Red Hat 7.0, 7.2,8,9, Mandrake 9.0, 9.2, Knoppix, DSL, Fedora Core 4,Solaris 8
Posts: 73

Rep: Reputation: 15
Question MySQl/Php

Hi All:
I have Php 4 and MySQL 3.23.53a installed on a Redhat 7.2 box. Both programs work fine individually but when I try to send data from a Php form to a MySQL database I get the following error in the browser:

Fatal error: Call to undefined function: mysql_connect() in /var/www/html/test.php on line 10

I also tried creating a database in MySQL from the shell prompt and inserted data into it without any problems but when I tried to access using a PhP script I got the same mysql_connect() error. Can anyone help?
Old 12-10-2002, 05:02 PM   #2
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,550

Rep: Reputation: 136Reputation: 136
function dbconnect ($dbname="mydb",$user="someone",$server="localhost"
if (!($mylink = mysql_connect($server,$user)))
print "<h3>could not connect to database</h3>\n";

did u call the function like that, or did u call it without arguments?
cheers, jens
Old 12-11-2002, 11:41 AM   #3
Registered: Nov 2002
Location: Central VA
Distribution: Ubuntu/Debian
Posts: 228

Rep: Reputation: 32
I had the same exact problem. It turned out that PHP did not have MySql support configured. I had to recompile PHP with --with-mysql[=DIR]
Include MySQL support. DIR is the MySQL base directory. If unspecified, the bundled MySQL library will be used.
Old 12-11-2002, 09:58 PM   #4
Registered: Sep 2001
Location: Houston
Distribution: Red Hat 7.0, 7.2,8,9, Mandrake 9.0, 9.2, Knoppix, DSL, Fedora Core 4,Solaris 8
Posts: 73

Original Poster
Rep: Reputation: 15
Thanks people, I will give those two suggestions a try tomorrow and post the results.
Old 12-14-2002, 12:48 AM   #5
Registered: Aug 2001
Location: Sacramento, CA
Distribution: Gentoo 1.4+
Posts: 195

Rep: Reputation: 30
Red hat does not install MySQL support for apache by Default


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql-server4.1 and mod php-mysql conflig kernelvn *BSD 0 06-18-2005 11:52 AM
Problem getting PHP to recognize MySQL, Using PHP 4.0 and MySQL 4.0.20 d2army Programming 4 06-27-2004 08:54 PM
php4 mysql, installation, php-pages with mysql info stay empty dnla Linux - Software 2 03-14-2004 02:54 PM
Installing MySQL.4.0.17 and php support for Mysql on RedHat 9.0 Neha Linux - Software 13 12-29-2003 12:06 AM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration