kalabox Posted April 19, 2011 Report Share Posted April 19, 2011 (edited) Sveiki, kaut kas nav ar sintakti manam sql lūk tabula DROP TABLE IF EXISTS `default_setup_academic`; CREATE TABLE IF NOT EXISTS `default_setup_academic` ( `academic_id` bigint(20) NOT NULL auto_increment, `academic_name` text NOT NULL, `academic_order` bigint(20) NOT NULL, PRIMARY KEY (`academic_id`) ) TYPE=MyISAM AUTO_INCREMENT=7 AUTO_INCREMENT=7 ; INSERT INTO `default_setup_academic` VALUES (1, 'Doctorate', 1); INSERT INTO `default_setup_academic` VALUES (2, 'Master', 2); INSERT INTO `default_setup_academic` VALUES (3, 'Bachelor', 3); INSERT INTO `default_setup_academic` VALUES (4, 'Associate', 4); INSERT INTO `default_setup_academic` VALUES (5, 'Senior High', 5); INSERT INTO `default_setup_academic` VALUES (6, 'Junior High', 6); Un lūk kādu kļūdu met. SQL vaicājums: CREATE TABLE IF NOT EXISTS `default_setup_academic` ( `academic_id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT , `academic_name` TEXT NOT NULL , `academic_order` BIGINT( 20 ) NOT NULL , PRIMARY KEY ( `academic_id` ) ) TYPE = MYISAM AUTO_INCREMENT =7 AUTO_INCREMENT =7; 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 'TYPE=MyISAM AUTO_INCREMENT=7 AUTO_INCREMENT=7' at line 6 ----------------------------------------- Vaina bija pie TYPE, vajadzēja uz ENGINE nomainīt Edited April 19, 2011 by kalabox Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted April 19, 2011 Report Share Posted April 19, 2011 (edited) Vaina bija pie TYPE, vajadzēja uz ENGINE nomainīt mulkjibas - vainigs ir tas ka 2 reizes atkartojas AUTO_INCREMENT =7 AUTO_INCREMENT =7; un jaunaka SQL versija parasti lieliski saprtot veco versiju vaicajumus ( TYPE un ENGINE ) Edited April 19, 2011 by Grey_Wolf Quote Link to comment Share on other sites More sharing options...
kalabox Posted April 19, 2011 Author Report Share Posted April 19, 2011 Varētu būt ka dēl AUTO_INCREMENT=7 atkārtošanās tiek izvadītās neskaitāmas šādas kļūdas? Notice: Undefined variable: slocation in C:\xampp\htdocs\job\setting.php on line 73 Notice: Use of undefined constant joblocation_id - assumed 'joblocation_id' in C:\xampp\htdocs\job\setting.php on line 68 PHP.ini vareeja kaut kaa izslēgt šos paziņojumus, man tā liekas.. Quote Link to comment Share on other sites More sharing options...
Val Posted April 19, 2011 Report Share Posted April 19, 2011 Kāds sakars sql'am ar līki uzrakstītu php? Quote Link to comment Share on other sites More sharing options...
kalabox Posted April 19, 2011 Author Report Share Posted April 19, 2011 Tiesa, laikam nekāda: $country_name = $row[country_name]; Jābut laika šādi $country_name = $row["country_name"]; Quote Link to comment Share on other sites More sharing options...
daGrevis Posted April 19, 2011 Report Share Posted April 19, 2011 Izslēgt, protams, var. Tikai vai vajag...? Tas ir reāli stulbākais ko var izdarīt!!! Quote Link to comment Share on other sites More sharing options...
kalabox Posted April 19, 2011 Author Report Share Posted April 19, 2011 Hmm, bet saliekot visur " tagat rāda Notice: Undefined variable: lang in C:\xampp\htdocs\job\admin\setting.php on line 236 = Array($lang["lang_dayname_1"], $lang["lang_dayname_2"], $lang["lang_dayname_3"], $lang["lang_dayname_4"], $lang["lang_dayname_5"], $lang["lang_dayname_6"], $lang["lang_dayname_7"]); Cik noprotu ar vecāku PHP versiju tādi gļuki nebūtu..? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted April 19, 2011 Report Share Posted April 19, 2011 Nē. Būtu gan. Skaties kā tas notiekās... Notice: Undefined variable: lang in C:\xampp\htdocs\job\admin\setting.php on line 236 Tas ir jāizlasa. Tur rakstīts, ka mainīgais "lang" nav definēts. Definēts nozīmē to, ka Tu centies izdarīt kaut ko ar to mainīgo, bet tam nav dota vērtība. Piemēri... ++$x; $x += 1; $x = $x + 1; // Nav zināms cik ir $x. strToUpper( $myString ); // Nav zināms kas ir $myString. Vispirms ir jāpiešķir vērtība... $x = 3.14; $myString = 'daGrevis'; P.S. Tāpēc cilvēki, kad sāk mācīties programmēt, sāk to darīt ar Pascal'u (visbiežāk). Pascal'ā ir obligāti jādefinē mainīgais pirms tas tiek izmantots. program foobar; var x : integer; {* Integrālis bez noteiktas vērtības ir "0". *} myString : string; begin myString = 'daGrevis'; x := x + 1; myString := AnsiUpperCase( myString ); end. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.