Now I tried to write a php-script to create a MySQL-table called "my_news".
I keep getting the "failed"-message
I can't see what's wrong...
CODE
<?php
/* Connecting, selecting database */
$link = mysql_connect("localhost", "username", "password")
or die("Could not connect");
print "Connected successfully";
mysql_select_db("database") or die("Could not select database");
$query = "CREATE TABLE my_news {
id int (10 ) NOT NULL auto_increment ,
title varchar (100 ) NOT NULL ,
text text NOT NULL ,
PRIMARY KEY (id )
}";
echo "
creating table [b]my_news[/b]... ";
$q = mysql_query($query) or die ("<font face=ff0000>failed</font>");
echo "<font color=00ff00>succeeded</font>
";
/* Closing connection */
mysql_close($link);
?>
/* Connecting, selecting database */
$link = mysql_connect("localhost", "username", "password")
or die("Could not connect");
print "Connected successfully";
mysql_select_db("database") or die("Could not select database");
$query = "CREATE TABLE my_news {
id int (10 ) NOT NULL auto_increment ,
title varchar (100 ) NOT NULL ,
text text NOT NULL ,
PRIMARY KEY (id )
}";
echo "
creating table [b]my_news[/b]... ";
$q = mysql_query($query) or die ("<font face=ff0000>failed</font>");
echo "<font color=00ff00>succeeded</font>
";
/* Closing connection */
mysql_close($link);
?>