[MYSQL] INSERT query fout, kom er niet uit

Pagina: 1
Acties:

  • klaaz
  • Registratie: April 2000
  • Laatst online: 24-04 16:54

klaaz

it's me!

Topicstarter
Ik wordt gek, duizend keer overheen gekeken en deze simpele Query blijft een foutmelding geven:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
INSERT INTO res_flightlog( 
                            mem_id, 
                            res_id, 
                            air_id, 
                            stamp_date, 
                            air_identification, 
                            air_reg, 
                            departure_place, 
                            departure_time, 
                            arrival_place, 
                            arrival_time, 
                            block_time, 
                            flight_time, 
                            category, 
                            landing, 
                            landing_place, 
                            touch1, 
                            touch1_place, 
                            touch2, 
                            touch2_place, 
                            con_night, 
                            con_instr, 
                            con_hood, 
                            pic, 
                            dual, 
                            instructor, 
                            remarks, 
                            personal_remarks, 
                            stamp_entry, 
                            stamp_changed 
                            ) 
VALUES (
                            '5285', 
                            '', 
                            '', 
                            '', 
                            'c172', 
                            'phbak', 
                            'EHLE', 
                            '11:29', 
                            'EHGG', 
                            '12:29', 
                            '', 
                            '01:10', 
                            'se', 
                            '', 
                            'EHGG', 
                            '', 
                            '', 
                            '', 
                            '', 
                            '', 
                            '', 
                            '', 
                            '01:10', 
                            '', 
                            '0', 
                            '', 
                            '', 
                            '1130583809', 
                            '1130583809'
                            )


De foutmelding:
MySQL retourneerde:

#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 'dual, instructor, remarks, personal_remarks, stamp_entry, stamp_

Er ziten volgens mij geen reserved words in... Ik zie het niet :(

[ Voor 139% gewijzigd door klaaz op 29-10-2005 12:46 ]


  • mjax
  • Registratie: September 2000
  • Laatst online: 26-04 17:27
Dual is een reserved keyword.
From MySQL 4.1.0 on, you are allowed to specify DUAL as a dummy table name in situations where no tables are referenced:

mysql> SELECT 1 + 1 FROM DUAL;
-> 2

DUAL is purely a compatibility feature. Some other servers require this syntax.
Je kunt de veldnamen volgens mij ook quoten met backticks om dit soort problemen te voorkomen.

[ Voor 99% gewijzigd door mjax op 29-10-2005 12:46 ]


  • BasieP
  • Registratie: Oktober 2000
  • Laatst online: 19-10-2025
idd, gebruik backquotes om je kolomnamen en enkele quotes om je data (wat je al doet)

dus
SQL:
1
INSERT INTO `bla` (`bla1`, `bla2`) VALUES ('1', '2');

[ Voor 22% gewijzigd door BasieP op 29-10-2005 12:46 ]

This message was sent on 100% recyclable electrons.


  • klaaz
  • Registratie: April 2000
  • Laatst online: 24-04 16:54

klaaz

it's me!

Topicstarter
Allemachtig wat snel... Thanks to both! You saved my day :)