Create table in mysql with php

Before doing anything with mysql database we need at least one table in our database.Here we are going to make table with name employees.For making table decide about the fields of table. Here for table employees four fields are decided and for that query is as follow :
Create Table employees (
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
first_name varchar(50),
last_name varchar(50),
salary varchar(50) DECIMAL(18,2,)
);

Now we try to create table with php

<?php

$host="localhost";
$user="mysql_user_name";
$pass="mysql_password";
$db="database_name";
$link=mysql_connect($host,$user,$pass) or
die("Could not connect database".mysql_error());

if($link)
{
mysql_select_db($db,$link) or die("could not select database".mysql_error());
$query="Create Table employees (id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
first_name varchar(50),
last_name varchar(50),
salary varchar(50) DECIMAL(18,2)
);";
mysql_query($query) or die("could not make query".mysql_error());
mysql_close($link);
echo "Table is created successfully!!!";
}
?>

As we see above mysql_connection opens connection, if connection is not opened, die function is called for getting error through mysql_error(). If connection is created scuccessfully , then mysql_select_db() function selects database, if database is selected, mysql_query fires our query and connection is closed by mysql_close otherwise die function is called for getting error in selecting database.