与mySQL相关的数据库名称

I'm working on developing a website through Dreamweaver with html, php, and mySQL, and I wanna connect it to the localhost, so I installed easyPHP and added an alias in the local files with the name saadstore and the directory of the folder However, when I run my code it displays an error when the database name is selected! Instead if I run a page that doesn't interact with links and other pages in my site (doesn't need connection) it works just fine! Here's the code:

<?php
$db_host="localhost";
$db_username="root";
$db_pass="";
$db_name="saadstore";

mysql_connect("$db_host","$db_username","$db_pass")or die("Could not connect to mySQL"); 
mysql_select_db("$db_name")or die("no database");
?>

when I save and open the file from the localhost I get "no database" I'm kinda new to this so .. any help?

The mysql_* functions are deprecated/obsolete, and will soon be removed from PHP entirely, please don't use them.

Instead you should use PDO: http://php.net/pdo

Example from php.net:

<?php
/* Connect to an ODBC database using driver invocation */
$dsn = 'mysql:dbname=testdb;host=127.0.0.1';
$user = 'dbuser';
$password = 'dbpass';

try {
    $dbh = new PDO($dsn, $user, $password);
} catch (PDOException $e) {
    echo 'Connection failed: ' . $e->getMessage();
}

Try out this:-

<?php
$db_host="localhost";
$db_username="root";
$db_pass="";
$db_name="saadstore";

$conn = mysql_connect($db_host, $db_username, $db_pass)or die("Could not connect to mySQL"); 
$selected = mysql_select_db($db_name, ,$conn)or die("no database");
?>

At last

  mysql_close($conn);

You Can Try "mysqli_connect" Like that way :

$conn = mysqli_connect("localhost","my_user","my_password","my_db");

First of all, you should use AcidReign solution, it's using PDO instead of the deprecated mysql_*. I also don't know anything about easyPHP, but realize you actually don't have a database called saadstore. Then, access on your browser the adress http://localhost/phpmyadmin it's gonna ask you the username and password that according to you the user is root and you haven't any password.

After you log in you will see a screen like the below:

enter image description here

On the left side you can see all your databases, if the name saadstore is not there, then you don't have the database and need to create them. To do so, you must go to DataBase tab and put the name of your database(saadstore) and the Collation, which I recommend to put utf8_general_ci.

enter image description here

Now you have your database and may create your tables.