Linking php and mysql

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Cheeseboy
Forum Commoner
Posts: 67
Joined: Thu Mar 23, 2006 2:43 pm

Linking php and mysql

Post by Cheeseboy »

Hi, I have phpbb installed and ready to go but i dont know how to get php and mysql linked? I have the extensions i was missing. :D
Last edited by Cheeseboy on Sun Mar 26, 2006 5:39 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I thought you were using Linux. :?
User avatar
Cheeseboy
Forum Commoner
Posts: 67
Joined: Thu Mar 23, 2006 2:43 pm

Post by Cheeseboy »

i am i read that i just need to go now a php version and everything will be fine. Ill try it now.
User avatar
Cheeseboy
Forum Commoner
Posts: 67
Joined: Thu Mar 23, 2006 2:43 pm

Post by Cheeseboy »

yep now i have the php_mysql.dll
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Post by a94060 »

if phpbb is installed,should the php and mysql be linked already? :?
jrd
Forum Commoner
Posts: 53
Joined: Tue Mar 14, 2006 1:30 am

Post by jrd »

a94060 wrote:if phpbb is installed,should the php and mysql be linked already? :?
it should be unless the server isn't running...
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Post by a94060 »

thats what i thought,why does it even matter if the two are linked?
User avatar
Cheeseboy
Forum Commoner
Posts: 67
Joined: Thu Mar 23, 2006 2:43 pm

Post by Cheeseboy »

how would i start the server? I deleted everything that had to do with mysql and reinstalled it.
User avatar
Cheeseboy
Forum Commoner
Posts: 67
Joined: Thu Mar 23, 2006 2:43 pm

Post by Cheeseboy »

The only reason i asked how to link them is best i get this error on phpbb:
The PHP configuration on your server doesn't support the database type that you chose
and people tell me that there not linked properly. How can i fix this error its driving me crazy! 8O is there some kind of file like php.ini and httpd for mysql?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

if you have two instances of mysql installed, then i doubt either of them are running

try a simple query,
like

Code: Select all

mysql_connect('localhost','user','pass') or die(mysql_error())
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Cheeseboy
Forum Commoner
Posts: 67
Joined: Thu Mar 23, 2006 2:43 pm

Post by Cheeseboy »

I still dont know how to start the server. I want to know if i have it installed right. Because when i did that php code i got:
Fatal error: Call to undefined function: mysql_connect() in /var/www/Esgames4uweb/phpinfo.php on line 2
but i think and I know its becasue its not running.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

you don't have the mysql extensions installed/enabled.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

what distro is this? there may be ways to set this up without compiling php but it differs by distro
User avatar
Cheeseboy
Forum Commoner
Posts: 67
Joined: Thu Mar 23, 2006 2:43 pm

Post by Cheeseboy »

slackware :D and i have the php_mysql.dll if thats the extension yuor talkign about
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

DLL implies windows, linux uses an so file. The file is called mysql.so and goes into the php extensions directory. I know in fedora I do yum install php-mysql, hopefully someone knows the slackware equiv. to that.



Edit, oh yeah you could also do it manually, just gotta obtain the file and load it in php.ini then do service httpd restart
Post Reply