Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Sql error
Forum PHP.pl > Forum > Bazy danych
prest
Hej

Ktos moze ma pojecie gdzie jest problem

  1. SQL query:
  2.  
  3. CREATE TABLE calendar(
  4. cal_id int NOT NULL AUTO_INCREMENT ,
  5. owner_id int,
  6. titlechar( 80 ) ,
  7. notechar( 120 ) ,
  8. date date,
  9. starttimechar( 5 ) ,
  10. stoptimechar( 5 ) ,
  11. repeat enum( 'Y', 'N' ) DEFAULT 'N',
  12. interv int,
  13. repeattype enum( 'DAY', 'WEEK', 'MONTH', 'YEAR' ) ,
  14. until date,
  15. lastupdate date,
  16. updateby int,
  17. calread enum( 'Y', 'N' ) DEFAULT 'N',
  18. calwrite enum( 'Y', 'N' ) DEFAULT 'N',
  19. calupdate enum( 'Y', 'N' ) DEFAULT 'N',
  20. caldelete enum( 'Y', 'N' ) DEFAULT 'N',
  21. PRIMARY KEY ( cal_id )
  22. )
  23.  
  24. MySQL said: Documentation
  25. #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 'repeat enum('Y','N') DEFAULT 'N',
  26. interv int,
  27. repeattype enum('DAY','WEEK','M' at line 9
sf
czy repeat nie jest słowem kluczowym? wtedy daj je tak `repeat`
prest
Cytat(sf @ 4.05.2007, 17:19:03 ) *
czy repeat nie jest słowem kluczowym? wtedy daj je tak `repeat`


Oczywiscie ze jest ale ja wolalbym aby ktos podal rozwiazanie:)
sf
a nie podałem? snitch.gif
prest
Cytat(sf @ 4.05.2007, 17:45:05 ) *
a nie podałem? snitch.gif



nie jestem na tyle obeznany z sql smile.gif niestety potzrebuje syntax sorki
Daimos
Cytat(sf @ 4.05.2007, 17:19:03 ) *
czy repeat nie jest słowem kluczowym? wtedy daj je tak `repeat`

nie rozumiesz co tam wyzej kolega sf napisal?
slowo repeat umiesc w tych ciapkach `````````
dlatego ze repeat jest zarezerwowanym slowem
prest
Cytat(my salsa @ 4.05.2007, 17:59:36 ) *
nie rozumiesz co tam wyzej kolega sf napisal?
slowo repeat umiesc w tych ciapkach `````````
dlatego ze repeat jest zarezerwowanym slowem



ciagle ten sam error
nospor
  1. CREATE TABLE `calendar` (
  2. `cal_id` int(11) NOT NULL AUTO_INCREMENT,
  3. `owner_id` int(11) DEFAULT NULL,
  4. `title` char(80) DEFAULT NULL,
  5. `note` char(120) DEFAULT NULL,
  6. `date` date DEFAULT NULL,
  7. `starttime` char(5) DEFAULT NULL,
  8. `stoptime` char(5) DEFAULT NULL,
  9. `repeat` enum('Y','N') DEFAULT 'N',
  10. `interv` int(11) DEFAULT NULL,
  11. `repeattype` enum('DAY','WEEK','MONTH','YEAR') DEFAULT NULL,
  12. `until` date DEFAULT NULL,
  13. `lastupdate` date DEFAULT NULL,
  14. `updateby` int(11) DEFAULT NULL,
  15. `calread` enum('Y','N') DEFAULT 'N',
  16. `calwrite` enum('Y','N') DEFAULT 'N',
  17. `calupdate` enum('Y','N') DEFAULT 'N',
  18. `caldelete` enum('Y','N') DEFAULT 'N',
  19. PRIMARY KEY (`cal_id`)
  20. )


miales polaczone slowa kluczowe char z innymi slowami
prest
Cytat(nospor @ 4.05.2007, 18:08:59 ) *
  1. CREATE TABLE `calendar` (
  2. `cal_id` int(11) NOT NULL AUTO_INCREMENT,
  3. `owner_id` int(11) DEFAULT NULL,
  4. `title` char(80) DEFAULT NULL,
  5. `note` char(120) DEFAULT NULL,
  6. `date` date DEFAULT NULL,
  7. `starttime` char(5) DEFAULT NULL,
  8. `stoptime` char(5) DEFAULT NULL,
  9. `repeat` enum('Y','N') DEFAULT 'N',
  10. `interv` int(11) DEFAULT NULL,
  11. `repeattype` enum('DAY','WEEK','MONTH','YEAR') DEFAULT NULL,
  12. `until` date DEFAULT NULL,
  13. `lastupdate` date DEFAULT NULL,
  14. `updateby` int(11) DEFAULT NULL,
  15. `calread` enum('Y','N') DEFAULT 'N',
  16. `calwrite` enum('Y','N') DEFAULT 'N',
  17. `calupdate` enum('Y','N') DEFAULT 'N',
  18. `caldelete` enum('Y','N') DEFAULT 'N',
  19. PRIMARY KEY (`cal_id`)
  20. )


miales polaczone slowa kluczowe char z innymi slowami



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 'repeat enum( 'Y', 'N' ) DEFAULT 'N',interv int,repeattype enum( 'DAY', 'WEEK', '' at line 1
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.