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
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Feb 02, 2004 4:46 pm
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?
qads
DevNet Resident
Posts: 1199 Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane
Post
by qads » Mon Feb 02, 2004 5:01 pm
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.
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Feb 02, 2004 5:27 pm
Well you got that right .. it doesnt see the mysql @ all lol..
weird, it is running tho.. ( any fix ? )
Straterra
Forum Regular
Posts: 527 Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:
Post
by Straterra » Mon Feb 02, 2004 5:29 pm
PHP5...isn't it still in it's BETA stages anyway?
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Feb 02, 2004 5:33 pm
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?
Straterra
Forum Regular
Posts: 527 Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:
Post
by Straterra » Mon Feb 02, 2004 5:38 pm
Maybe PHP5 requires an MySQL extension or something? I would avise you use 4 until more support is available for 5.
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Feb 02, 2004 5:41 pm
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..
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Feb 02, 2004 5:53 pm
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. ;-(
jaxn
Forum Commoner
Posts: 55 Joined: Fri Jan 16, 2004 1:50 pm
Location: Nashville, TN
Post
by jaxn » Mon Feb 02, 2004 8:44 pm
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
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Tue Feb 03, 2004 8:55 am
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
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
infolock
DevNet Resident
Posts: 1708 Joined: Wed Sep 25, 2002 7:47 pm
Post
by infolock » Tue Feb 03, 2004 4:59 pm
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...