I started tutorials on MySQL and PHP database connection.
I have one problem... I don't know how to create the actual database on the server (and the server is not mine, i just connect to it through ftp username and password).
I know how to create a table but it is unable to connect to the db (I assume that this is so becaue this db is not yet created, and i am trying to create a table on an inexistint db)
<title>CREATE DB</title>
<?php
$user="teenfellowship";
$password="welcome";
$db="mydb";
mysql_connect(localhost,$user,$password);
@mysql_select_db($db) or die("Unable to select database");
$query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first varchar(30) NOT NULL,last varchar(30) NOT NULL,phone varchar(20) NOT NULL,PRIMARY KEY (id),UNIQUE id (id))";
mysql_query($query);
mysql_close();
?>
How do I create the DB before creating the table???
thanks in advance,
Matt