...

View Full Version : Connect to mysql using PHP



CanMike
01-06-2006, 03:30 PM
I think I've got a configuration problem.

When I issue the command

$link = mysql_connect('localhost','root','<pswd>');
if (!$link){ die('<message>');

I never get to the 'if' statment.

The error I get is:

"Fatal error: Call to undefined function mysql_connect() in /usr/local/apache2/thdocs/test2.php"

Does this mean it does not recognize the function or the connect argument?

I completely new at this and loaded mysql via Red Hat rpm.

Any suggestions?

arne
01-06-2006, 03:35 PM
Try this :

if(!($link_id = mysql_connect($hostadres, $username, $password))) die(mysql_error());

mark87
01-06-2006, 03:38 PM
PHP5 doesn't enable MySQL by default.

This page will be of use -
http://www.somacon.com/p109.php

arne
01-06-2006, 03:43 PM
what do you mean mark? Please explain me (i'm a total noob:confused: )

mark87
01-06-2006, 03:45 PM
The page I linked to explains the problem and solution.

Basically the MySQL extension library does not come with PHP (in Redhat only I think?), so you need to install it manually.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum