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

แชร์ ความรู้ในการ พัฒนา Joomla Component Extension Module Plugin

Moderator: mindphp, ผู้ดูแลกระดาน

ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

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

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

ตัวอย่าง 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 ; 
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 28