Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
-
ol4pr0
- Forum Regular
- Posts: 926
- Joined: Thu Jan 08, 2004 11:22 am
- Location: ecuador
Post
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
-
markl999
- DevNet Resident
- Posts: 1972
- Joined: Thu Oct 16, 2003 5:49 pm
- Location: Manchester (UK)
Post
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).
-
ol4pr0
- Forum Regular
- Posts: 926
- Joined: Thu Jan 08, 2004 11:22 am
- Location: ecuador
Post
by ol4pr0 »
Even when its not connecting local ?
I know seems bit weird but the mysql is running on a other machine