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

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: วิธีแก้ไข error import SQL Joomla

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

โดย 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 ออกมา ได้ฟิลด์มาไม่ครบ

โค้ด: เลือกทั้งหมด

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

โค้ด: เลือกทั้งหมด

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 ; 

ข้างบน