Galedajs Posted July 23, 2011 Report Share Posted July 23, 2011 Sveiki visiem, kas so lasa! Es meginu ielikt ieksa mysql datu baze web adresi, bet es nezinu kadus parametrus jauzstada ieks table. Tur vajag varchar, vai ko citu? Mans query: Pats query vispar ir pareizs? INSERT INTO user (name, surname, adult, img, sex, time, normal, special) VALUES(Janis, Janis, 1, http://inbox.lv, M, NOW(), '5', '1') Un no ta izmet sadu error: ERROR: Unknown Punctuation String @ 113 STR: :// #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 '://inbox.lv, M, NOW(), '5', '1')' at line 2 Paldies par palidzibu. Quote Link to comment Share on other sites More sharing options...
Faks Posted July 23, 2011 Report Share Posted July 23, 2011 (edited) INSERT INTO user (name, surname, adult, img, sex, time, normal, special) VALUES('Janis','Janis','1','inbox.lv','M', NOW(), '5', '1' ) ja nē liec dubult pēdiņas bet pacik te nekā tāda nau tad būtu jaiet :) ja atmiņa neviļ :) Edited July 23, 2011 by Faks Quote Link to comment Share on other sites More sharing options...
Galedajs Posted July 23, 2011 Author Report Share Posted July 23, 2011 O, paldies! Viss sanaca. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 23, 2011 Report Share Posted July 23, 2011 Iesaku likt tabulas nosaukumu un kolonas "bektikos", tas būtu: INSERT INTO `user` ('username`, `password`) ... Tas novērsīs kļūdas, kas var rasties, ja tāds nosaukums ir MySQL jau rezervētais vārds. Izmanto lielos burtus vārdiem, kas ir MySQL jau rezervētie vārdi - redzu, ka jau tā dari. Tas padarīs kveriju lasāmāku acīm. Sadali kaut kā visu kveriju pa daļām un katru daļu liec jaunā rindiņā. Piemērs: INSERT INTO ... WHERE ... LIMIT ... 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.