Skip to content Skip to sidebar Skip to footer

Sql Query Is Not Working On Phpmyadmin As I Am Getting An Error

I have entered this code on phpMyAdmin as an SQL query. I am trying to create a table (this is a copy and pasted code from another site) CREATE TABLE `members` ( `id` int(4) NO

Solution 1:

It should be ENGINE not TYPE to specify the storage engine:

CREATETABLE `members` (
`id` int(4) NOTNULL auto_increment,
`username` varchar(65) NOTNULLdefault'',
`password` varchar(65) NOTNULLdefault'',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 ;

see CREATE TABLE syntax:

table_option: ENGINE [=] engine_name

The option TYPE was removed with MySQL 5.5, deprecated since MySQL 4.0:

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 the Release Notes for MySQL 5.1.8.)

Source: CREATE TABLE, MySQL 5.1

Post a Comment for "Sql Query Is Not Working On Phpmyadmin As I Am Getting An Error"