TBS
Juniormester
21. maj 2020 - 14:19
Der er
5 kommentarer og 1 løsning
SQL
Jeg får en fejl når jeg prøver at køre forspørgelsen: -- -- Table structure for table `category` -- CREATE TABLE `category` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `category` -- ALTER TABLE `category` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `category` -- ALTER TABLE `category` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; In products table, I'm creating 6 columns with id, name, category id, product price, product image thumbnail, product description. -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `catid` int(11) NOT NULL, `price` varchar(255) NOT NULL, `thumb` varchar(255) NOT NULL, `description` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; Hvad skal jeg gøre for at den ikke fejler?
Annonceindlæg fra DE-CIX
Har du lyst til at afsløre hvilken fejl du får på hvilken SQL sætning?
TBS
Juniormester
21. maj 2020 - 14:47
#2
Fejl Statisk analyse: Der blev fundet 2 fejl under analysen. Slut quote ' var ventet. (near "" at position 755) Ukendt type af statement. (near "IN" at position 0) SQL-forespørgsel: Kopi IN products TABLE, I 'm creating 6 columns with id, name, category id, product price, product image thumbnail, product description. -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `catid` int(11) NOT NULL, `price` varchar(255) NOT NULL, `thumb` varchar(255) NOT NULL, `description` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; MySQL returnerede: Dokumentation #1064 - Der er en fejl i SQL syntaksen nær 'IN products TABLE, I 'm creating 6 columns with id, name, category id, prod' på linje 1
TBS
Juniormester
21. maj 2020 - 14:57
#3
Linje 30: In products table, I'm creating 6 columns with id, name, category id, product price, product image thumbnail, product description. Ukendt type af statement. (Nær In ) Linje 36: MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; Slut quote ' var ventet. (nær )
Øhm. "In products table, I'm creating 6 columns with id, name, category id, product price, product image thumbnail, product description." er engelsk ikke SQL.
Synes godt om
1 synes godt om dette
TBS
Juniormester
21. maj 2020 - 15:00
#5
Åhh, jeg prøver lige at fjerne det
TBS
Juniormester
21. maj 2020 - 15:01
#6
Det hjalp. Tak
Kurser inden for grundlæggende programmering