This gave the same error you had even with my own details (not shown below - those are fakies

):
Code: Select all
<?php
$host = 'localhost';
$user = 'myuser';
$pass = 'mypass';
$db = mysql_connect($host, $user, $pass) || die("something went wrong");
$dbName = "mytestdb";
echo $dbName;
mysql_select_db($dbName, $db);
?>
Using this didnt:
Code: Select all
<?php
$host = 'localhost';
$user = 'myuser';
$pass = 'mypass';
$db = mysql_connect($host, $user, $pass) OR die("something went wrong");
$dbName = "mytestdb";
echo $dbName;
mysql_select_db($dbName, $db);
?>
Nor did:
Code: Select all
<html>
<head>
<title>check this out page</title>
</head>
<body>
<?php
$host = 'localhost';
$user = 'myuser';
$pass = 'mypass';
$db = mysql_connect($host, $user, $pass)
$dbName = "mytestdb";
echo $dbName;
mysql_select_db($dbName, $db);
if (!$db) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
?>
</body>
</html>
Try the second one instead

Though the third works well too
