Attempting to create a database and table and insert some data
<p>This is what I have so far.... I do not understand why it is not working? Any ideas? This is just a simple script to connect to a database, create a table and insert some data. I also want to retrieve the data but I think I may be jumping a little a head. </p>

<pre><code>    &lt;?php

    ini_set('display_errors',1);
    error_reporting(E_ALL);

    $link = mysql_connect('localhost', 'root', '');
    if (!$link) {
        die('Could not connect: ' . mysql_error());
    }
    echo 'Connected successfully';

    if (mysql_query("CREATE_DATABASE nogjhghkgst98", $link))
    {
        echo "Database created";
    }
    else
    {
        echo "Error creating database: " . mysql_error();
    }

    if ($link="CREATE TABLE contactsZ8 (id int(6) NOT NULL auto_increment,first varchar(15)         NOT         NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT     NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY     (id),UNIQUE id (id),KEY id_2 (id))") {
        echo "ineserted";
    }
    else
    {
        echo "not inserted" . mysql_error();
    }

    $link = "INSERT INTO contactsZ VALUES ('','John','Smith','01234 567890','00112 334455','01234     567891','johnsmith@gowansnet.com','http://www.gowansnet.com')";

    $link="SELECT * FROM contactsZ";
    $link=mysql_query($link);

    mysql_close($link);

    ?&gt;
</code></pre>
