Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7769351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:08:18+00:00 2026-06-01T16:08:18+00:00

I was create tables with the syntax in phpmyadmin: DROP TABLE IF EXISTS users;

  • 0

I was create tables with the syntax in phpmyadmin:

DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS info;

CREATE TABLE users (
  user_id int unsigned NOT NULL auto_increment,
  email varchar(100) NOT NULL default '',
  pwd varchar(32) NOT NULL default '',
  isAdmin int(1) unsigned NOT NULL,
  PRIMARY KEY  (user_id)
) TYPE=INNODB;

CREATE TABLE info (
  info_id int unsigned NOT NULL auto_increment,
  first_name varchar(100) NOT NULL default '',
  last_name varchar(100) NOT NULL default '',
  address varchar(300) NOT NULL default '',
  zipcode varchar(100) NOT NULL default '',
  personal_phone varchar(100) NOT NULL default '',
  mobilephone varchar(100) NOT NULL default '',
  faxe varchar(100) NOT NULL default '',
  email2 varchar(100) NOT NULL default '',
  country varchar(100) NOT NULL default '',
  sex varchar(1) NOT NULL default '',
  birth varchar(1) NOT NULL default '',

  email varchar(100) NOT NULL default '',
  PRIMARY KEY  (info_id),
  FOREIGN KEY (email) REFERENCES users(email) ON UPDATE CASCADE ON DELETE CASCADE
) TYPE=INNODB;

But shows the error:

“#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=INNODB’ at line 11 “

If I remove the TYPE=INNODB in the end of create the tables, it will show the error:

“#1005 – Can’t create table ‘curriculo.info’ (errno: 150) “.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:08:20+00:00Added an answer on June 1, 2026 at 4:08 pm

    Use ENGINE = INNODB, not TYPE = InnoDB.

    From MySQL docs, version 5.1, CREATE TABLE syntax:

    Note

    The older TYPE option was synonymous with ENGINE. TYPE has been deprecated since MySQL 4.0 but is still supported for backward compatibility in MySQL 5.1 (excepting MySQL 5.1.7). Since MySQL 5.1.8, it produces a warning. It is removed in MySQL 5.5. You should not use TYPE in any new applications, and you should immediately begin conversion of existing applications to use ENGINE instead. (See Section D.1.64, “Changes in MySQL 5.1.8 (Not released)”.)


    If you want to have this Foreign Key:

    FOREIGN KEY (email) REFERENCES users(email)
    

    the users(email) should have a UNIQUE constraint. All Foreign Keys should reference either a Primary or a Unique Key. You want a row in the info table to reference (through the FK) one and only one user (row in the users table).


    Best practise though (for various reasons) is to have narrow (small) and constant-wide columns as Foreign Keys. Your email is 100 characters which could be from 100 to 300 bytes (depending on the charset). So, you may consider using user_id as the FK, which is just 4 bytes wide:

    CREATE TABLE info (
      ...
                 ---- email varchar(100) NOT NULL default '',   
                 ---- removed
      user_id int unsigned NOT NULL, 
      PRIMARY KEY  (info_id),
      FOREIGN KEY (user_id) REFERENCES users(user_id)
          ON UPDATE CASCADE ON DELETE CASCADE
    ) TYPE=INNODB;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given these tables: create table Orders ( Id INT IDENTITY NOT NULL, primary key
SQL Query: CREATE TABLE mytbl.customer( CustID int( 10 ) NOT NULL AUTO_INCREMENT , FirstName
CREATE TABLE `pastebin` ( `pid` int(11) NOT NULL auto_increment, `poster` varchar(16) default NULL, `posted`
i have 2 tables CREATE TABLE if not exists tag_name( + tagid INTEGER PRIMARY
CREATE TABLE titlexplan( id INTEGER NOT NULL, title_id INTEGER NOT NULL , plan_id INTEGER
when i run the following command in phpmyadmin. CREATE TABLE subscribers ( 'subscriber_id' int(11)
I would like to create a virtual table with a similar syntax SELECT 'sk:
Hi Following is the syntax for creating table in mysql. I want to create
Create two tables with some ids overlapping. create table outer_table ( id integer, overlap_in
I used the phpMyAdmin form to create a table, i.e. I filled in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.