RaaapuLis Posted April 30, 2008 Report Share Posted April 30, 2008 Shis kods Kas nau pareizs? Link to comment Share on other sites More sharing options...
black Posted April 30, 2008 Report Share Posted April 30, 2008 Nesapratu divas lietas: 1) Kāpēc izmanto latin charsetu? 2) Kāda jēga laukam pie definīcijas likt NOT NULL DEFAULT ''? Link to comment Share on other sites More sharing options...
andrisp Posted April 30, 2008 Report Share Posted April 30, 2008 Raapulis, varbūt tomēr apraksti, kas par problēmu ? Neizveidojas tabulas ? Kļūdas paziņojumi kādi ? black, un kas tur slikts, ka NOT NULL DEFAULT '' ? Link to comment Share on other sites More sharing options...
RaaapuLis Posted April 30, 2008 Author Report Share Posted April 30, 2008 (edited) Aizmirsu pateikt ka esmu galigs n00bs mysql, tapec nezinu ko darit. Neesiet bargi :/ 1. a ka nomainit? :( 2. Jap, tabulas neizveidojas, errors te -> SQL vaicājums: CREATE TABLE `keys` ( `user_id` int( 11 ) NOT NULL AUTO_INCREMENT , `key` varchar( 32 ) NOT NULL DEFAULT '', PRIMARY KEY ( `user_id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1 CREATE TABLE `messages` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT , `from` varchar( 255 ) NOT NULL DEFAULT '0', `to` varchar( 255 ) NOT NULL DEFAULT '0', `message` longtext NOT NULL , `title` varchar( 255 ) NOT NULL DEFAULT '', `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP , `read` int( 1 ) NOT NULL DEFAULT '0', PRIMARY KEY ( `id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1 CREATE TABLE `users` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT , `username` varchar( 255 ) NOT NULL DEFAULT '', `password` varchar( 32 ) NOT NULL DEFAULT '', `name` varchar( 255 ) NOT NULL DEFAULT '', `email` varchar( 255 ) NOT NULL DEFAULT '', `ip` varchar( 255 ) NOT NULL DEFAULT '', `admin` int( 1 ) NOT NULL DEFAULT '0', PRIMARY KEY ( `id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1 MySQL teica: #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 `messages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `from` varchar' at line 7 Edited April 30, 2008 by RaaapuLis Link to comment Share on other sites More sharing options...
black Posted April 30, 2008 Report Share Posted April 30, 2008 NULL vērtības laukiem tak tieši tam ir paredzētas, lai varētu pateikt, ka nav datu. Glabāt tukšu stringu tur, kur varētu glabāt NULL, manuprāt, nav īsti gudri. Link to comment Share on other sites More sharing options...
andrisp Posted April 30, 2008 Report Share Posted April 30, 2008 Nu, no praktiskā viedokļa mazāk problēmu ir, ja neizmanto null. Runāju tieši par count(), salīdzināšanām utt. Raapuli, pameegjini pa vienam tos kverijus izpildiit. Link to comment Share on other sites More sharing options...
kasisppr Posted April 30, 2008 Report Share Posted April 30, 2008 Ja MySQL-ā vēlies izpildīt vairākus pieprasījumus vienā piegājienā, tos jāatdala ar semikolu; ... ) ENGINE=MYISAM DEFAULT CHARSET=latin1; CREATE TABLE ... Link to comment Share on other sites More sharing options...
RaaapuLis Posted May 1, 2008 Author Report Share Posted May 1, 2008 paldies kasisppr un citiem arii. Probleema tieshaam bija semikols :D (ka es vareju nepamanit) Varat slegt Link to comment Share on other sites More sharing options...
Recommended Posts