A little advise please
| From: | denis at comtechservices dot com | Date: | Wed, 11 Dec 2002 16:23:04 +0000 |
| Subject: | A little advise please | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-24072@lists.php.net to get a copy of this message | ||
Hello,
I have a bit of problem with a script . . . looking for help. The
script pretty much works as it creates the table I want, However,
the display is incorrect as it states the creation was unsuccessful.
Here is the actual script:
<HTML>
<HEAD>
<TITLE>This PHP script creates a table called Feedback in a
database called livetest</TITLE>
<BODY>
<?php
$Host="localhost";
$User="root";
$Pasword="";
$DBName="livetest";
$TableName="$Name";
if ($Link=mysql_connect($Host, $User, $Password)){
print("Successfully connected to the
database<BR>\n");
}else{
print ("Sorry, we did not successfully connect to the
database.<BR>\n");
}
$Query="CREATE TABLE $TableName (ID INT UNSIGNED NOT
NULL AUTO_INCREMENT PRIMARY KEY, FirstName TEXT,
LastName TEXT, Email TEXT, Comments TEXT)";
if (mysql_db_query ($DBName, $query, $Link)){
print("<BR>The table creation was a success!");
} else {
print("<BR>Sorry, the table was not created
successfully.");
}
mysql_db_query ($DBName, $Query, $Link);
mysql_close($Link);
?>
</BODY>
</HTML>
Now, as I said, the table does get created. But the output says:
"Successfully connected to the database
Sorry, the table was not created successfully. "
What on earth am I doing wrong?
Thanks for the help (in advance).
Denis Lahaie
denis@comtechservices.com