Page 1 of 1

PHP 5.04 and MySQL 4.1.1

Posted: Thu May 05, 2005 4:27 pm
by php_wiz_kid
Hey everyone,
I looked around on the forum for this but I couldn't find it. I can't get PHP 5.0.4 to connecto to a MySQL 4.1.1 database. When I do a mysql_connect() it will connect to the server, but the mysql_select_db() won't work. The mysqli functions won't work either. I copied the latest libmysql.dll over to my root PHP folder. I read that PHP 5 isn't built with MySQL or something like that. How can I use MySQL with PHP then?

Posted: Thu May 05, 2005 4:37 pm
by timvw
Edit your php.ini so the mysql extension is loaded...

I have php5.0.4 and mysql4.1.7 running on my WinXP Pro machine.. So i know it works :)

Posted: Thu May 05, 2005 5:04 pm
by php_wiz_kid
I've done that and I still have the same problem. Thanks though.

Posted: Thu May 05, 2005 5:12 pm
by php_wiz_kid
It turns out it wasn't a PHP problem. For some reason I can't get my scripts to work with a username and password other than root. Weird...

Posted: Thu May 05, 2005 5:16 pm
by php_wiz_kid
It turns out I'm a dumbass. Ugh!

Posted: Tue May 17, 2005 8:03 am
by samkeller
I have another problem with these versions working together.
I use winxp pro,php 5.0.4 and mysql 4.1 .they work fine but my php cant load mysql
I copy libmuSQL.dll to php root and remove ; before php_mysql.dll in my php.ini,however,it says cant load dynamic library and when I rename the mysql.dll to libmysql.dll in php.ini it says its not a correct php library
what should I do???
thanks

Posted: Tue May 17, 2005 10:29 pm
by php_wiz_kid
Ok, here's what I'd check.

Make sure you have mysql.dll uncommented in php.ini (which you said you already did).

Make sure C:/php (or whatever your directory path to PHP) is set in your PATH environment variable. (I bet this is your problem). If you don't know how to set environment variables then just ask. I'll help.

Make sure mysql.dll is actually in your C:/php/ext folder.

Make sure that you have the latest version of libmysql.dll (you'll find this somewhere in your MySQL directory path). You can use phpinfo() to check if you have the latest version.

Copy the latest version of libmysql.dll into your PHP and Apache (if you're using Apache and if you don't already have the latest version) folder. I don't know if this is actually necessary but I read this somewhere and I did it, and my MySQL works with PHP but I don't know if that made a difference.

Posted: Tue May 17, 2005 11:49 pm
by samkeller
It seems I dont have mysql.dll at all.
where can I find that??

Posted: Tue May 17, 2005 11:57 pm
by php_wiz_kid
It should come with your PHP distro. Are you running PHP under Apache or IIS?

Posted: Wed May 18, 2005 1:25 am
by timvw
afaik you need php_mysql.dll and libmysql.dll. they are both in the zip distribution.

if you add the mysql/bin directory to your path, you already have the libmysql.dll

Posted: Wed May 18, 2005 5:52 am
by samkeller
I have libmysql.dll in bin folder but what about php_mysql.dll???

Posted: Wed May 18, 2005 8:44 pm
by php_wiz_kid
It SHOULD have came with your PHP distro. If it didn't then download PHP 5.0.4 from http://www.php.net. Just copy it from the zipped file (it should be in the ext folder) to your C:/php/ext directory.

Sorry for calling php_mysql.dll, mysql.dll. I didn't mean to give you wrong information.