A little advise please

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux