Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Mysql query


Maikol

Recommended Posts

Hi am trying to install the admin package Login and Logoff for osCommerce Administrators 1.4.6 am having issues with the table part this is what they say you have to insert which am using phpmyadmin

 

DROP TABLE IF EXISTS administrators;
CREATE TABLE administrators (
  administrator_id int(11) DEFAULT '0' NOT NULL auto_increment,
  username varchar(20) NOT NULL,
  password varchar(20) NOT NULL,
  allowed_pages varchar(255) DEFAULT '*' NOT NULL,
  PRIMARY KEY (administrator_id)
);

INSERT INTO administrators VALUES ( '1', 'admin', 'admin', '*');

 

when i insert it i get this error

 

Error 
SQL-query :  [Edit] 

CREATE TABLE administrators (
  administrator_id int(11) DEFAULT \'0\' NOT NULL auto_increment,
  username varchar(20) NOT NULL,
  password varchar(20) NOT NULL,
  allowed_pages varchar(255) DEFAULT \'*\' NOT NULL,
  PRIMARY KEY (administrator_id)
);

INSERT INTO administrators VALUES ( \'1\', \'admin\', \'admin\', \'*\');


MySQL said: 


You have an error in your SQL syntax near '\'0\' NOT NULL auto_increment,
  username varchar(20) NOT NULL,
  password v' at line 2

 

can anyone tell me what am doing wrong....or any help by anyone wrapping it up in a txt file...

 

thanks in advance

maikol w/luv

Link to comment
Share on other sites

Delete "NOT NULL" from the adminstrator_id query as follows:

 

DROP TABLE IF EXISTS administrators;

CREATE TABLE administrators (

  administrator_id int(11) auto_increment,

  username varchar(20) NOT NULL,

  password varchar(20) NOT NULL,

  allowed_pages varchar(255) DEFAULT '*' NOT NULL,

  PRIMARY KEY (administrator_id)

);

 

INSERT INTO administrators VALUES ( '1', 'admin', 'admin', '*');

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...