I'm not sure if this should be in the MySQL section, or the PHP, so if it should be elsewhere please let me know.
I have a small PHP/MySQL project. It has a PHP front end that connects to a MySQL database. It works perfectly on OS X, but when I attempt to run the script on Kubuntu Linux, it doesn't connect.
I extracted the connection code to test, and it seems that's where the problem is. This is the script:
When the script runs, the first echo statement displays, but the second doesn't. It's almost as it stalls on the link statement.
If anyone has any ideas, I'd be grateful for the help!
Peter V.
I have a small PHP/MySQL project. It has a PHP front end that connects to a MySQL database. It works perfectly on OS X, but when I attempt to run the script on Kubuntu Linux, it doesn't connect.
I extracted the connection code to test, and it seems that's where the problem is. This is the script:
Code:
<?php
// CONNECTDB.PHP - Updated: Monday July 8, 2009 - 6:23 PM
//$link = mysql_connect('localhost', 'root', 'jclark', 'PROJECT1');
[COLOR=blue]echo "before link....";[/color]
//
[COLOR=red]$link = mysql_connect('127.0.1.1', 'peterv', 'password','PROJECT1');[/color]
//
[COLOR=blue]echo "after link....";[/color]
if (!$link) {
die ('Connect failed: ' . mysql_error());
exit();
} else {
// select the database
$db_selected = mysql_select_db('PROJECT1', $link);
if (!$db_selected) {
die ('Database Selection failed: PROJECT1 ' . mysql_error());
}
}
If anyone has any ideas, I'd be grateful for the help!
Peter V.