LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-10-2002, 12:53 AM   #1
Pimple
Member
 
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, 06:02 PM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,532

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

did u call the function like that, or did u call it without arguments?
cheers, jens
 
Old 12-11-2002, 12:41 PM   #3
cmfarley19
Member
 
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, 10:58 PM   #4
Pimple
Member
 
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, 01:48 AM   #5
ChaosX2
Member
 
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
 
  


Reply


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 12:52 PM
Problem getting PHP to recognize MySQL, Using PHP 4.0 and MySQL 4.0.20 d2army Programming 4 06-27-2004 09:54 PM
php4 mysql, installation, php-pages with mysql info stay empty dnla Linux - Software 2 03-14-2004 03:54 PM
Installing MySQL.4.0.17 and php support for Mysql on RedHat 9.0 Neha Linux - Software 13 12-29-2003 01:06 AM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 09:59 PM


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

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