LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-14-2003, 12:52 PM   #1
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
mysql / php ?


Ok, i made the following php file named dbconnect.php:

<?php
mysql_connect("localhost", " ", " ") or
die ("Could not connect to database");
mysql_select_db("phonebook") or
die ("Could not select database");
?>

But when i access the dbconnect.php with my browser i get the following error:

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

Anyone knows what i am doing wrong?
 
Old 01-14-2003, 01:21 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
If you built php yourslef you will need to make sure you included '--with-mysql=/mysql/dir' while configuring. My config for php looks like this:
Code:
'./configure' \
'--with-apache=/usr/src/apache_1.3.22' \
'--with-png-dir=/usr/local' \
'--with-zlib-dir=/usr/local' \
'--with-jpeg-dir=/usr/local' \
'--with-pspell=/usr/local' \
'--with-gd=/usr' \
'--with-mysql=/usr' \
'--with-freetype-dir=/usr/local' \
'--enable-trans-sid' \
'--enable-track-vars' \
'--enable-shared' \
If you didn't build php yourself.. Hmm.. I'm not sure how you get a prebuilt php module for apache to have mysql support. Someone help...
 
Old 01-14-2003, 01:50 PM   #3
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
Smile

Never mind.

I thought i already installed php-mysql-4.1.2-7.i386.rpm but i didn't
But thanks for replying.
 
  


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:39 AM.

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
Open Source Consulting | Domain Registration