วิธีแก้ไข error import SQL Joomla

Post a reply

Smilies
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: วิธีแก้ไข error import SQL Joomla

วิธีแก้ไข error import SQL Joomla

by thatsawan » 22/06/2016 7:53 pm

ตัวอย่าง error
Error

Static analysis:

1 errors were found during analysis.

A closing bracket was expected. (near ")" at position 139)

SQL query:

CREATE TABLE `oysq5_assets` ( `id` int(10) UNSIGNED NOT NULL COMMENT 'Primary Key', `parent_id` int(11) NOT NULL DEFAULT '0'COMMENT )

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 4


ปัญหาเกิดจาก ตอน export ออกมา ได้ฟิลด์มาไม่ครบ

Code: Select all

CREATE TABLE `oysq5_assets` (
  `id` int(10) UNSIGNED NOT NULL COMMENT 'Primary Key',
  `parent_id` int(11) NOT NULL DEFAULT '0'COMMENT
) ;
วิธีแก้ไข เพิ่มฟิลด์ที่ขาดมาให้ครบ สามารถศึกษาได้จาก https://github.com/ronaldbradford/schem ... joomla.sql

Code: Select all

CREATE TABLE IF NOT EXISTS `oysq5_assets` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',
  `parent_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set parent.',
  `lft` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set lft.',
  `rgt` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set rgt.',
  `level` int(10) unsigned NOT NULL COMMENT 'The cached level in the nested tree.',
  `name` varchar(50) NOT NULL COMMENT 'The unique name for the asset.\n',
  `title` varchar(100) NOT NULL COMMENT 'The descriptive title for the asset.',
  `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_asset_name` (`name`),
  KEY `idx_lft_rgt` (`lft`,`rgt`),
  KEY `idx_parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=35 ; 

Top