I'm trying to connect to a MySQL database, PROJECT1, using a PHP script. This works perfectly in OS X, but when I run this in Kubuntu Linux, the first echo statement executes, displaying "before link....", then nothing happens. It should display the "after link...." echo statement.
If anyone can help me out, I'd appreciate it. (This was posted in MySQL board, but no replies, so I assumed it should have been posted here.)
Thanks,
Peter V.
Code:
<?php
// CONNECTDB.PHP - Updated: Monday July 8, 2009 - 6:23 PM
echo "before link....";
//
[COLOR=red]$link = mysql_connect('127.0.0.1', 'peterv', 'password','PROJECT1');[/color]
//
echo "after link....";
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());
}
}
Thanks,
Peter V.