Page 1 of 1

undefined mysql_connect

Posted: Mon Feb 09, 2004 8:34 pm
by ol4pr0
the following code worked fine with mysql on localhost..

however from a linux box connecting to a other computer i didnt anymore

Anybody got some ideas>???

Code: Select all

$host = '10.10.10.2';
$user = 'root';
$pass = '';

$connection = mysql_connect($host, $user)
or die("cannot make connection");
//select our database email 
$db = mysql_select_db("email" , $connection)
or die("cannot find database");
//insert the values of our form into our database
$sql_query = "INSERT INTO email VALUES ("$company","$name","$email")";
$results = mysql_query($sql_query);

Code: Select all

ERROR
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/mail/joinnewsletter.php on line 7

Posted: Mon Feb 09, 2004 8:50 pm
by markl999
Either PHP needs recompiling --with-mysql or you just need to uncomment/add extension=mysql.so in your php.ini (and restart apache).

If you installed a distro package then you might just need to install it's php4-mysql package (or equivilent name).

Posted: Tue Feb 10, 2004 9:21 am
by ol4pr0
Even when its not connecting local ?

I know seems bit weird but the mysql is running on a other machine