1

I want to import an SQL file to my phpMyAdmin database, the file contains tables about a restaurant application and a table about the admin login, but I have 2 unexpected errors, I really don't see what is exactly wrong with that?. here is the error message:

Static analysis: 2 errors were found during analysis.

  1. An opening bracket followed by a set of values was expected. (near "CREATE" at position 285)
  2. Unexpected token. (near "CREATE" at position 285)

SQL query:

-- -- Déchargement des données de la table `operation` -- 

    INSERT INTO `operation` (`numop`, `numcp`, `prenom`, `nom`, `type`, `numcp2`, `mentant`, `date`) VALUES 

-- -------------------------------------------------------- -- 
-- Structure de la table `reclamation` -- 

    CREATE TABLE `reclamation` (
    `numrec` int(11) NOT NULL
    ,`id` varchar(8) NOT NULL
    ,`prenom` varchar(30) NOT NULL
    ,`nom` varchar(30) NOT NULL
    ,`text` text NOT NULL
    ,`date` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;

MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE `reclamation` ( `numrec` int(11) NOT NULL, `id` varchar(8) NO' at line 14

CREATE TABLE `reclamation` (
  `numrec` int(11) NOT NULL,
  `id` varchar(8) NOT NULL,
  `prenom` varchar(30) NOT NULL,
  `nom` varchar(30) NOT NULL,
  `text` text NOT NULL,
  `date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
2
  • 2
    the create table has np error it is the insert that misses data Commented Feb 22, 2022 at 20:24
  • 2
    You have nothing after VALUES in the INSERT query. Also, the file needs ; between the queries. Commented Feb 22, 2022 at 20:26

1 Answer 1

1

There are no values after VALUES in operation insertion query.

This error points on create because this is the next to the insertion and it expected to be values but actually is CREATE ...

It seems the values cutted off, make sure to separate between queries with ;

INSERT INTO `operation` (`numop`, `numcp`, `prenom`, `nom`, `type`, `numcp2`, `mentant`, `date`) VALUES 

-- Structure de la table reclamation --

CREATE TABLE `reclamation` (
`numrec` int(11) NOT NULL
,`id` varchar(8) NOT NULL
,`prenom` varchar(30) NOT NULL
,`nom` varchar(30) NOT NULL
,`text` text NOT NULL
,`date` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.