Chat
Micro Mart Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



MYSQL Grrrrr Expand / Collapse
Author
Message
Posted 03/10/2005 20:00:05


Pentium

PentiumPentiumPentiumPentiumPentium

Group: Forum Members
Last Login: Yesterday @ 22:01:34
Posts: 5,536, Visits: 29,229
Ok so all of my expertise is exhausted I need your help. A mate of mine has Apache, PHP and Mysql (latest versions except apache which is 1.1). I know it all works because I installed it!

Mysql can be accessed form the console easy enough but not from the PHP code - I think the problem is at the PHP end because it brings up the usual:

Fatal error: Call to undefined function mysql_connect() in c:\program files\apache group\Apache\htdocs\4.php on line 2


That is if connecting via mysql_connect() or mysqli_connect() etc.

The strangest thing is that after the mysql function it stops parsing the document!!!! So no other code works1

Any Ideas cos I am getting pretty annoyed at the moment!

Cheers,
Tom
My Crime is that of curiosity, my crime is that of outsmarting you




Post #68962
Posted 03/10/2005 20:28:58


Root

RootRootRootRootRoot

Group: Moderators
Last Login: 04/01/2009 14:35:06
Posts: 610, Visits: 2,563
His PHP has no MySQL support. I've no idea how you enable this under Windows - possibly you need to download the appropriate extension from somewhere.

--
David Johnson
Micro Mart Writer & Forum Moderator
Post #68966
Posted 03/10/2005 20:37:49


Pentium

PentiumPentiumPentiumPentiumPentium

Group: Forum Members
Last Login: Yesterday @ 22:01:34
Posts: 5,536, Visits: 29,229
Yeah it has Mysql set up as a service, and it works but thats all - no PHP connection 2 it!!!

Cheers,
Tom
My Crime is that of curiosity, my crime is that of outsmarting you




Post #68968
Posted 03/10/2005 20:56:08


Root

RootRootRootRootRoot

Group: Moderators
Last Login: 04/01/2009 14:35:06
Posts: 610, Visits: 2,563
MySQL support needs to be enabled within PHP else PHP will not be able to access MySQL.

--
David Johnson
Micro Mart Writer & Forum Moderator
Post #68972
Posted 03/10/2005 21:04:37


Pentium

PentiumPentiumPentiumPentiumPentium

Group: Forum Members
Last Login: Yesterday @ 22:01:34
Posts: 5,536, Visits: 29,229

In the PHP.ini file - I did check all the extensions are there - actually all of them are edited in hmmmmmmm

 

could be a clash problem - too many extensions!



Cheers,
Tom
My Crime is that of curiosity, my crime is that of outsmarting you




Post #68973
Posted 03/10/2005 22:43:47


Root

RootRootRootRootRoot

Group: Moderators
Last Login: 04/01/2009 14:35:06
Posts: 610, Visits: 2,563
Did you restart Apache after enabling MySQL support in PHP? You'll need to do this else it won't reload the configuration.

If you still can't get anywhere, create a PHP file with the following in it:

<?php

phpinfo();

?>

This will give you pages of data - if MySQL support is there you'll see a whole section about it.

--
David Johnson
Micro Mart Writer & Forum Moderator
Post #68985
Posted 04/10/2005 16:24:03


286

286286286286286

Group: Forum Members
Last Login: 10/02/2008 16:21:18
Posts: 487, Visits: 370

Is the MySQL database on the same server?

It sounds similarish to a problem i am currently having on a free hosting server. I use the CURL PHP function to get a web page and extract data from that web page via PHP defined functions. This CURL function had been working flawlessly but suddenly stopped working around the same time they upgraded their servers. I have found out since that they have installed a firewall which my guess is that the firewall is blocking the CURL connections out of the server, their admins are looking into it. This gives the same symptoms as you are having, any p**** errors before the CURL session execute line are reported but there aren't any after the CURL session execution (i know that its at the exact CURL session execution as i have made lots of experiments and its always at this position). It seems that PHP 'Hangs' if it tries to make a connection out of the server and it can't connect. Its just a thought that if the MySQL database is on a different server it could be a firewall blocking the outward connection.




We're all n00bs till we get the knowledge & skillz, its just that some are n00bier!

snowbum.nildram.co.uk 


Yes, I coded this stat sig, used by many around the world, SMUG, ME, NEVER!

Post #69035
Posted 04/10/2005 19:24:39


Pentium

PentiumPentiumPentiumPentiumPentium

Group: Forum Members
Last Login: Yesterday @ 22:01:34
Posts: 5,536, Visits: 29,229
Yeah thats an good idea - the server is apache and it is set up on his computer - I installed it so i kno they are in the right place.....

I suppose the firewall could be blocking the port - Ikno you connect to the localhost server through port 80 and that works fine. Does it connect to Mysql through a different port because teh Firewall could well be blocking that, hmmm.........

Thanks for the ideas guys keep it coming!!!!!

Cheers,
Tom
My Crime is that of curiosity, my crime is that of outsmarting you




Post #69050
Posted 22/10/2005 15:32:50


Pentium

PentiumPentiumPentiumPentium