Page 1 of 1

php5

Posted: Mon Feb 02, 2004 4:46 pm
by ol4pr0
oke this worked fine with php4

but with php5 it gave me this error

Code: Select all

Fatal error: Call to undefined function mysql_connect() in C:\php5\PEAR\include\db.php on line 4
with this

Code: Select all

$dbase ="home";
$tablename ="pongo";
$connect= mysql_connect('localhost', 'root') // line 4
	or die("Cant connect: " .mysql_error());
$result=mysql_select_db($dbase)
is there something changed in the mysql functions with php5?

Posted: Mon Feb 02, 2004 5:01 pm
by qads
maybe php cant see mysql at all, try [php_man]phpinfo[/php_man] function in a file and check to see if can spot MYSQL in there or not.

Posted: Mon Feb 02, 2004 5:27 pm
by ol4pr0
Well you got that right .. it doesnt see the mysql @ all lol..

weird, it is running tho.. ( any fix ? )

Posted: Mon Feb 02, 2004 5:29 pm
by Straterra
PHP5...isn't it still in it's BETA stages anyway?

Posted: Mon Feb 02, 2004 5:33 pm
by ol4pr0
Yes it is still in the beta . however dont see why it shouldnt be able to see the mysql...

Surely it will have some bugs.. but a bug like that?

Posted: Mon Feb 02, 2004 5:38 pm
by Straterra
Maybe PHP5 requires an MySQL extension or something? I would avise you use 4 until more support is available for 5.

Posted: Mon Feb 02, 2004 5:41 pm
by ol4pr0
Yea its no biggie however it would of been nice knowing why it causes a error on php5.

Still i do believe that php5 would have a bug like that..

maby with a Alpha i 'could' believe it..

Posted: Mon Feb 02, 2004 5:53 pm
by ol4pr0
WEll after all you might be right..

suposely you need to install the libraries youreself to have it running with the mysql. They might not going to include it like they did with previous php versions. ;-(

Posted: Mon Feb 02, 2004 8:44 pm
by jaxn
This explains why:
http://jeremy.zawodny.com/blog/archives/000812.html

Basically it is so we as PHP developers can still sell apps running on PHP without having to pay MySQL a licensing fee (even if the app you distribute doesn't use MySQL, if the library is bundled and you sell it, you owe it).

-Jackson

Posted: Tue Feb 03, 2004 8:55 am
by ol4pr0
Yea i have seen that article however i got it to run with apache2

trying to get it to run on apache 1.3.- gave me some serious errors with loading up the php_mysql.dll

by adding the line

Code: Select all

extension=php_mysql.dll
it will run ( just problems with a violation error on RE-starting apache2 )

Also it seems that the original php_mysql.dll might not work
so i for safety i copied the mysql.dll from my php4 into the root of php5

Didnt try the php5 php_mysql.dll

But i guess if you feel up to it you could give it a try ;-)

Posted: Tue Feb 03, 2004 4:59 pm
by infolock
i'm running apache 2, php 5, and newest mysql release and it works fine for me... well, *worked* fine for me before my puter died.. :(

anyways, i'm assuming you are using this with windows..

again worked for me. just installed php as a module on apache and copied the needed mysql dll's and it worked fine for me..

might want to make sure mysql is up and running...