Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    What do I do with this structure file in PHPMyAdmin?

    Hey all,

    I'm a n00b when it comes to MySQL, so your help is definitely appreciated!

    I just downloaded a PHP software package from SourceForge. I was able to follow the installation instructions perfectly, except for the final step, which read:

    - Create a database and use "DBSTRUCTURE.sql" to add the tables using phpMyAdmin (www.phpmyadmin.net).
    (Command line cracks know what to do with "DBstructure.sql")

    So, I went ahead and created a MySQL database.

    Then I opened PHPMyAdmin. I found my database so pulled it up, and then clicked "import." I selected the DBstructure.sql file, but got the following error message:

    Code:
    SQL query:
    
    #
    # Structure for the phpAlumni database
    #
    #
    # Tabellenstruktur f�r Tabelle `contacts` # C
    REATE TABLE contacts(
    contact_id int( 10 ) unsigned NOT NULL AUTO_INCREMENT , initiator int( 10 ) unsigned NOT NULL default '0', recipient int( 10 ) unsigned NOT NULL default '0', acceptancechar( 1 ) NOT NULL default '0', PRIMARY KEY ( contact_id )
    ) TYPE = MYISAM ;
    
    MySQL said: Documentation
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 15
    Any tips on what I'm doing wrong? For what it's worth, the entire DBSTRUCTURE.sql file reads:

    Code:
    #
    # Structure for the phpAlumni database
    #
    
    #
    # Tabellenstruktur für Tabelle `contacts`
    #
    
    CREATE TABLE contacts (
      contact_id int(10) unsigned NOT NULL auto_increment,
      initiator int(10) unsigned NOT NULL default '0',
      recipient int(10) unsigned NOT NULL default '0',
      acceptance char(1) NOT NULL default '0',
      PRIMARY KEY  (contact_id)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `forum_messages`
    #
    
    CREATE TABLE forum_messages (
      message_id int(10) unsigned NOT NULL auto_increment,
      thread_id int(10) unsigned NOT NULL default '0',
      title varchar(255) default NULL,
      message text,
      author int(10) unsigned NOT NULL default '0',
      timestamp timestamp(14) NOT NULL,
      PRIMARY KEY  (message_id)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `forum_sections`
    #
    
    CREATE TABLE forum_sections (
      section_id int(10) unsigned NOT NULL auto_increment,
      title varchar(255) NOT NULL default '',
      description varchar(255) NOT NULL default '',
      timestamp timestamp(14) NOT NULL,
      PRIMARY KEY  (section_id)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `forum_threads`
    #
    
    CREATE TABLE forum_threads (
      thread_id int(10) unsigned NOT NULL auto_increment,
      section_id int(10) unsigned NOT NULL default '0',
      title varchar(255) default NULL,
      message text,
      author int(10) unsigned NOT NULL default '0',
      timestamp timestamp(14) NOT NULL,
      PRIMARY KEY  (thread_id)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `jobfair`
    #
    
    CREATE TABLE jobfair (
      job_id int(10) unsigned NOT NULL auto_increment,
      originator_id int(10) unsigned NOT NULL default '0',
      last_modification timestamp(8) NOT NULL,
      company varchar(30) NOT NULL default '',
      job_industry varchar(30) NOT NULL default '',
      title varchar(30) NOT NULL default '',
      salary varchar(20) NOT NULL default '',
      city varchar(30) NOT NULL default '',
      country varchar(30) NOT NULL default '',
      description text NOT NULL,
      prerequisites text NOT NULL,
      benefits text NOT NULL,
      contact varchar(40) NOT NULL default '',
      start_date date NOT NULL default '0000-00-00',
      experience tinyint(3) unsigned NOT NULL default '0',
      PRIMARY KEY  (job_id)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `members`
    #
    
    CREATE TABLE members (
      id int(10) unsigned NOT NULL auto_increment,
      first_name varchar(30) NOT NULL default '',
      last_name varchar(30) NOT NULL default '',
      password varchar(20) NOT NULL default '',
      email varchar(40) NOT NULL default '',
      home_address varchar(40) NOT NULL default '',
      home_address_extra varchar(40) NOT NULL default '',
      home_zip varchar(10) NOT NULL default '',
      home_city varchar(30) NOT NULL default '',
      home_state varchar(30) NOT NULL default '',
      home_country varchar(30) NOT NULL default '',
      home_phone varchar(30) NOT NULL default '',
      home_cellphone varchar(30) NOT NULL default '',
      birthday date NOT NULL default '0000-00-00',
      home_homepage varchar(40) NOT NULL default '',
      year year(4) NOT NULL default '0000',
      term varchar(10) NOT NULL default '-----',
      home_other_info text NOT NULL,
      majors text NOT NULL,
      company_name varchar(30) NOT NULL default '',
      position varchar(30) NOT NULL default '',
      industry varchar(30) NOT NULL default '',
      company_address varchar(40) NOT NULL default '',
      company_address_extra varchar(40) NOT NULL default '',
      company_zip varchar(10) NOT NULL default '',
      company_city varchar(30) NOT NULL default '',
      company_state varchar(30) NOT NULL default '',
      company_country varchar(30) NOT NULL default '',
      company_phone varchar(30) NOT NULL default '',
      company_cellphone varchar(30) NOT NULL default '',
      company_homepage varchar(40) NOT NULL default '',
      company_description text NOT NULL,
      company_other_info text NOT NULL,
      terms_ok char(1) NOT NULL default '0',
      first_login char(1) NOT NULL default '1',
      timestamp timestamp(14) NOT NULL,
      subgroup smallint(5) unsigned NOT NULL default '0',
      PRIMARY KEY  (id),
      UNIQUE KEY Email (email),
      UNIQUE KEY ID (id),
      KEY name (first_name,last_name),
      KEY company (company_name),
      KEY home (home_city)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `members_subgroup`
    #
    
    CREATE TABLE members_subgroup (
      subgroup_id smallint(5) unsigned NOT NULL auto_increment,
      subgroup varchar(40) NOT NULL default '',
      PRIMARY KEY  (subgroup_id)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `news`
    #
    
    CREATE TABLE news (
      news_id int(10) unsigned NOT NULL auto_increment,
      headline varchar(255) NOT NULL default '',
      body text NOT NULL,
      timestamp timestamp(14) NOT NULL,
      PRIMARY KEY  (news_id)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `newsletters`
    #
    
    CREATE TABLE newsletters (
      id smallint(5) unsigned NOT NULL auto_increment,
      subject varchar(255) NOT NULL default '',
      body text NOT NULL,
      recipients varchar(50) NOT NULL default '',
      timestamp timestamp(14) NOT NULL,
      PRIMARY KEY  (id)
    ) TYPE=MyISAM;
    Last edited by aufvr; 03-04-2013 at 11:49 AM.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,023
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    It looks like you simply have a problem in your input text file.

    Notice this part of the error message:
    # Tabellenstruktur f�r Tabelle `contacts` # C

    That is actually parts of *FOUR* lines of your text all jammed together.

    It looks like you file is missing end-of-line characters on some lines.

    When I copied your text into MySQL directly, it worked fine *EXCEPT* that
    Code:
    TYPE=MyIsam
    is bogus. That should be
    Code:
    ENGINE=MyIsam
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    aufvr (03-04-2013)

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    TYPE isn't valid on an table option for create. It was available in the past, but was deprecated in favour of the ENGINE keyword in 4.x versions. It was removed in 5.x from the looks of it.

    Quick glance looks okay, but I can't be sure if it'll work. Rename the TYPE options to ENGINE and try again.

    A better option though would be to dump the software you have, and look for something newer. If it was written for Mysql < 5, than chances are the PHP code is high version 3x or low version 4.x. Despite backwards compatibility attempts, there is actually a lot that won't work properly without some minor modifications between the 4.x and 5.x versions of PHP. That assumes PHP of course.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • Users who have thanked Fou-Lu for this post:

    aufvr (03-04-2013)

  • #4
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you both! This really helped!
    Last edited by aufvr; 03-04-2013 at 07:28 PM.

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    You are missing a space between timestamp and timestamp.
    It sure does bother me that mysql let that one slide as an exception to the reserved words lol.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

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