Web Analytics Made Easy -
StatCounter Problem to create table - CodingForum

Announcement

Collapse
No announcement yet.

Problem to create table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem to create table

    Dear all,

    I have problem when i try to execute this on PhpMyadmin:

    CREATE TABLE `lsql_Links` (
    `ID` int(10) UNSIGNED NOT NULL,
    `Title` varchar(100) NOT NULL DEFAULT '',
    `URL` varchar(255) NOT NULL DEFAULT 'http://',
    `LinkOwner` varchar(50) NOT NULL DEFAULT 'admin',
    `Add_Date` date NOT NULL DEFAULT '0000-00-00',
    `Mod_Date` date NOT NULL DEFAULT '0000-00-00',
    `Description` text,
    `Contact_Name` varchar(255) DEFAULT NULL,
    `Contact_Email` varchar(255) DEFAULT NULL,
    `Hits` int(11) NOT NULL DEFAULT '0',
    `isNew` enum('No','Yes') NOT NULL DEFAULT 'No',
    `isChanged` enum('No','Yes') NOT NULL DEFAULT 'No',
    `isPopular` enum('No','Yes') NOT NULL DEFAULT 'No',
    `isValidated` enum('No','Yes') NOT NULL DEFAULT 'Yes',
    `Rating` float(12,2) NOT NULL DEFAULT '0.00',
    `Votes` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
    `Status` smallint(6) NOT NULL DEFAULT '0',
    `Date_Checked` datetime DEFAULT '0000-00-00 00:00:00',
    `Timestmp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
    `Recommended` int(11) DEFAULT NULL,
    `Bad_Link` text,
    `Detailed_Hits` int(11) DEFAULT '0'
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    The error is:

    #1067 - Unknown error 1067

    Please help me on hps to fix this, Thank you so much

  • #2
    Have you selected a database before trying to create the table? Your create statement works just fine when a database has been selected.
    Dave .... HostMonster for all of your hosting needs

    Comment


    • #3
      Just remove the default value in Date because data type of date is already in format "0000-00-00"

      Code:
      CREATE TABLE `lsql_Links` (
      `ID` int(10) UNSIGNED NOT NULL,
      `Title` varchar(100) NOT NULL DEFAULT '',
      `URL` varchar(255) NOT NULL DEFAULT 'http://',
      `LinkOwner` varchar(50) NOT NULL DEFAULT 'admin',
      `Add_Date` date NOT NULL ,
      `Mod_Date` date NOT NULL ,
      `Description` text,
      `Contact_Name` varchar(255) DEFAULT NULL,
      `Contact_Email` varchar(255) DEFAULT NULL,
      `Hits` int(11) NOT NULL DEFAULT '0',
      `isNew` enum('No','Yes') NOT NULL DEFAULT 'No',
      `isChanged` enum('No','Yes') NOT NULL DEFAULT 'No',
      `isPopular` enum('No','Yes') NOT NULL DEFAULT 'No',
      `isValidated` enum('No','Yes') NOT NULL DEFAULT 'Yes',
      `Rating` float(12,2) NOT NULL DEFAULT '0.00',
      `Votes` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
      `Status` smallint(6) NOT NULL DEFAULT '0',
      `Date_Checked` datetime,
      `Timestmp` timestamp NOT NULL ,
      `Recommended` int(11) DEFAULT NULL,
      `Bad_Link` text,
      `Detailed_Hits` int(11) DEFAULT '0'
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1

      Comment

      Working...
      X