lvspeedy Posted April 23, 2004 Report Share Posted April 23, 2004 Soien visu dienu meginu uztaisit skriptu kas ievieto datu baaazee informaaciju bet nesanaak sitas php $dbha=@mysql_connect("localhost","root","123456789123456789")or die ("nesanak1"); @mysql_select_db("speedy",$dbha)or die ("nesanak2"); $res=@mysql_query("insert into baze values(null,'e','s','s')")or die ("nesanak3"); printf ("Last inserted record has id %d\n", mysql_insert_id()); tas butu mysql tabulai create table baze ( id int not null auto_increment , nick varchar(50) not null , pass varchar(50) not null , name varchar(50) not null , pilseta varchar(50) not null , dzimene numeric not null , dzimums varchar(50) not null , telefons varchar(50) not null , bilde varchar(50) not null , texts varchar(50) not null , pievienojas numeric not null , mail varchar(50) not null , primary key (id) ) problema taada, ka vins man neievieto visaas kolonaas vajadziigo tekstu, ja meegina tikai piemeeram ieikt infu nick tad iet varbut kads, zin, lasiju gramatu neatradu un manuaali arii neko neatradu Link to comment Share on other sites More sharing options...
lvspeedy Posted April 23, 2004 Author Report Share Posted April 23, 2004 aizmirsu piebilst ka vis apstajas pie sitas rindas $res=@mysql_query("insert into baze values(null,'e','s','s')")or die ("nesanak3"); Link to comment Share on other sites More sharing options...
Aleksejs Posted April 23, 2004 Report Share Posted April 23, 2004 tev nav defaultās vērtības nodefinētas. Un ir uzlikts, ka kolonnas nedrīkst but null (NOT NULL) - tātad obligāti jāievada visu kolonnu vērtības. Link to comment Share on other sites More sharing options...
bubu Posted April 24, 2004 Report Share Posted April 24, 2004 ja rakasta insertu ne visaam kolonnaam tad taas ir jaauzskaita: INSERT INTO baze (nick, pass,name) VALUES ('bubu', 'bubu', 'tralalaa') INSERT sintaksi vispaar pats zini? (manuaalii nedomaajis skatiities?) Link to comment Share on other sites More sharing options...
lvspeedy Posted April 24, 2004 Author Report Share Posted April 24, 2004 paldies viss ok =) manuaali lasiiju, bet taakaa man ar angleni svaiki sapratu ka tas darbojas tikai taa INSERT INTO baze (nick) VALUES ('bubu') ;) Link to comment Share on other sites More sharing options...
Recommended Posts