PDA

View Full Version : Connect to Mysql via PHP3


jonas
12-25-1998, 05:56 PM
I might be a idiot but I cant get it to work.
I tried a rather simple guestbook:
http://php.netvision.net.il/examples/get_example.php3?count=323

I changed the DB login to:

mysql_connect( "localhost", "xkapellet", "topsecret"); // connect to the database, since each part of this uses the connection, we can just connect once at the beginning
mysql_select_db( "xkapellet") or die( "Error opening database"); //select our database

I tried to connect via the 'mysql' util mysql -u xkapellet -pXXXXX
and it worked, but via php the fallowing errors appers (http://www.kapellet.org/gastbok/guestbook.php3):

Warning: MySQL Connection Failed: Can't connect to local MySQL server (2) in /big/dom/xkapellet/www/gastbok/guestbook.php3 on line 5

Warning: MySQL Connection Failed: Can't connect to local MySQL server (2) in /big/dom/xkapellet/www/gastbok/guestbook.php3 on line 6

Warning: MySQL: A link to the server could not be established in /big/dom/xkapellet/www/gastbok/guestbook.php3 on line 6
Error opening database

Have anyone got mysql and php to work togehter? I Have tried to get the database connection to work with other applications (a PHP3 version of slash!), without success..

HELP! :-)

Cheers!

//Jonas

Terra
12-26-1998, 01:42 AM
I think I have found a potential problem in PHP3 w/our MySQL... The library should be linking to 3.22.12 -- not 3.22.8 ...

I will be upgrading PHP3 tonight to 3.0.6 - I will force the proper linking and clean out some of the old libraries...

This should help resolve this issue...

Further discussions with MySQL and/or PHP3 are being moved to the dedicated forum we have created...

I am closing this thread now - to facilitate the move... http://www.aota.net/ubb/wink.gif

--
Terra
sysAdmin
FutureQuest