PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, February 20, 2022

[FIXED] #1064 - You have an error in your SQL syntax; check the manual ....your MariaDB server version for the right syntax to use near ')........ at line 1

 February 20, 2022     mysql, phpmyadmin, sql     No comments   

Issue

I am trying to execute this query with a huge query and this is my db query................................

 CREATE TABLE `mydb`.`govtracker` ( `id` DOUBLE(10000) NOT NULL , 
 `site_name` VARCHAR(255) NOT NULL , `region` VARCHAR(255) NOT NULL , 
 `site_type` VARCHAR(255) NOT NULL , `site_code` VARCHAR(255) NOT NULL , 
 `tac_name` VARCHAR(255) NOT NULL , `dt_readiness` DATE NOT NULL , `rfs` 
 BOOLEAN NOT NULL , `rfs_date` DATE NOT NULL , 
 `huawei_1st_submission_date` DATE NOT NULL , `te_1st_submission_date` 
 DATE NOT NULL , `huawei_2nd_submission_date` DATE NOT NULL , 
 `te_2nd_submission_date` DATE NOT NULL , `huawei_3rd_submission_date` 
 DATE NOT NULL , `te_3rd_submission_date` DATE NOT NULL , 
 `acceptance_date_opt` DATE NOT NULL , `acceptance_date_plan` DATE NOT 
 NULL , `signed_sites` VARCHAR(255) NOT NULL , `as_built_date` DATE NOT 
 NULL , `as_built_status` VARCHAR(255) NOT NULL , `date_dt` DATE NOT NULL 
 , `dt_status` VARCHAR(255) NOT NULL , `shr_status` VARCHAR(255) NOT NULL 
 , `dt_planned` INT(1000) NOT NULL , `integeration_status` VARCHAR(255) 
 NOT NULL , `comments_snags` LONGTEXT NOT NULL , `cluster_name` LONGTEXT 
 NOT NULL , `type_standalone_colocated` VARCHAR(255) NOT NULL , 
 `installed_type_standalone_colocated` VARCHAR(255) NOT NULL , `status` 
 VARCHAR(255) NOT NULL , `pending` VARCHAR(255) NOT NULL , 
 `pending_status` LONGTEXT NOT NULL , `problematic_details` LONGTEXT NOT 
 NULL , `ets_tac` INT(100000) NOT NULL , `region_r` VARCHAR(255) NOT NULL 
 , `sf6_signed_date` DATE NOT NULL , `sf6_signed_comment` LONGTEXT NOT 
 NULL , `comment_history` LONGTEXT NOT NULL , `on_air_owner` VARCHAR(255) 
 NOT NULL , `pp_owner` VARCHAR(255) NOT NULL , `report_comment` LONGTEXT 
 NOT NULL , `hu_opt_area_owner` VARCHAR(255) NOT NULL , `planning_owner` 
 VARCHAR(255) NOT NULL , `po_number` VARCHAR(255) NOT NULL , 
 `trigger_date` DATE NOT NULL , `as_built_status_tr` VARCHAR(255) NOT NULL 
 ) ENGINE = InnoDB; 

but I find this sql error

 #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 ') NOT NULL , `site_name` VARCHAR(255) NOT NULL , `region` 
 VARCHAR(255) NOT NUL' at line 1

Solution

What is DOUBLE(10000) supposed to be?

You can just use DOUBLE. However, making an id a double is highly not recommended. I would instead recommend:

id int auto_increment primary key,

or, if you think that int isn't big enough, use bigint.



Answered By - Gordon Linoff
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing