PHP Using PHP with MySQL Using Relationship Tables in MySQL Understanding Relationship Tables

Problems with Mysql file (1046 - No database selected)

Error SQL query:

CREATE TABLE sizes (

id INT( 11 ) NOT NULL AUTO_INCREMENT , size VARCHAR( 32 ) COLLATE utf8_unicode_ci DEFAULT NULL , order INT( 11 ) NOT NULL , PRIMARY KEY ( id ) ) ENGINE = INNODB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT =5;

MySQL said: Documentation

1046 - No database selected

No good, if you get problems just importing a file!

Problem is that I cant write "Create table"

1 Answer

Petros Sordinas
Petros Sordinas
15,911 Points

You have to tell SQL which database you are using

Either : USE database_name; or if the database does not exist CREATE DATABASE database_name USE database_name;

THANKS, I got it to work now...

Oki, my database name is: movikcrewhunter

USE movikcrewhunter; CREATE TABLE sizes ( id int(11)