SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HELP!! / Why do I keep getting this error and no print??

    Hello,

    I am a newbie with all this database stuff and I need some help. I am trying to make up a script that will create a table and begin the installation of data to a mySQL database.

    This will be for a phpNuke site.

    I attempted to run the script below but I have the following problems.

    1. The page is completely white with no printing at all after calling the page except for the error noted below.
    2. I keep getting a "parse error" at line 46. that refers to the following line of script,
    Code:
    did int(10) NOT NULL auto_increment,
    FULL CODE
    PHP Code:
    <?php
    ################## BEGIN THE FILE ################## 


    require_once("mainfile.php");
    global 
    $prefix$dbi;
    if (!
    is_admin($admin)) { die ("Sorry you are not an administrator, You can not install this module"); }

    /*********************************************************/
    /* Configuration Variables    */
    /*********************************************************/

    require("config.php");
    $host $dbhost;

    $database $dbname;

    $username $dbuname;

    $password $dbpass;

    mysql_connect($host$username$password);

    @
    mysql_select_db($database);

    ################## BEGIN THE INSTALL ################## 

    echo"<P>";
    echo
    "<P>";
    OpenTable();
    echo
    "<B>AUTOMATED WEB DATABASE INSTALL</B>";
    echo
    "<P>";

    #
    # Dropping Old Database if necessary`
    #
    echo"Dropping Old DB If Necessary<br>";
    mysql_query("DROP TABLE IF EXISTS $prefix"._abc."");
    echo
    "Dropped Old DB<br>";

    #
    # Table structure for table `nuke_abc`
    #

    echo"Creating New Table<br>";
    mysql_query("CREATE TABLE $prefix"._abc. (
      
    did int(10NOT NULL auto_increment,
      
    dic_word varchar(40NOT NULL default '',
      
    dic_def text NOT NULL,
      
    PRIMARY KEY  (did)
     )
    ");
    echo "
    ABC Table Created"<br>";

    ?>
    What am I doing wrong???

    Thanks in advance for any and all responses.

    WP1
    Webbing Along!!!

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take a look at this:
    PHP Code:
    mysql_query("CREATE TABLE $prefix"._abc. (
      
    did int(10NOT NULL auto_increment,
      
    dic_word varchar(40NOT NULL default '',
      
    dic_def text NOT NULL,
      
    PRIMARY KEY  (did)
     )
    "); // <== What is this quote doing here?? 
    Delete that '"' and see if you can get it in!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •