Danciic625 Posted January 17, 2008 Report Share Posted January 17, 2008 <? $playername = $_POST['playername']; $xp = $_POST['xp']; $ip = $_SERVER['REMOTE_ADDR']; $id = "6"; include('config.php'); $check = mysql_query("SELECT username FROM war3users WHERE username='$playername'"); $register = "INSERT INTO war3users ( playername, xp) VALUES('$playername', '$xp')"; mysql_query($register) or die(mysql_error()); mysql_close(); echo "COMPLETED!"; //header('location: index.php'); ?> Kas sajaa kodaa nepareizs ? Kad meegjinu pieregistreet man paraada Duplicate entry for '0' for key 1 Link to comment Share on other sites More sharing options...
bubu Posted January 17, 2008 Report Share Posted January 17, 2008 Kāds izskatās tabulas war3users CREATE teikums? Link to comment Share on other sites More sharing options...
Danciic625 Posted January 17, 2008 Author Report Share Posted January 17, 2008 Kaa apskatiities ? Link to comment Share on other sites More sharing options...
bubu Posted January 17, 2008 Report Share Posted January 17, 2008 A kā tad tu to izveidoji? Link to comment Share on other sites More sharing options...
mounkuls Posted January 18, 2008 Report Share Posted January 18, 2008 (edited) Kaa apskatiities ? Mja.... Ka tad vareji vispar bazi uzlikt un palaist ja to nezini? Es pats naku no WAP tautas, tur tas ir kaut cik normala paradiba ja panem skriptu, mistiska veida to uzliek(starp citu izmantojot specialus online FTP) un tad sakas jautajumi sakot ar ...Ka atzipot, ka rediget, kadu konfigu vajag, visadi citi gluki un visbeidzot ka sakonektet bazi un tad man neiet tas un tas. Web jau itka tam nevajadzetu but tik gruti ko sameklet. Tiem WAP lietotajiem nav pat briziem iespeja normala ar saviem WAP device pagooglet ka nakas..... Bet WEB.... Edited January 18, 2008 by mounkuls Link to comment Share on other sites More sharing options...
Aleksejs Posted January 18, 2008 Report Share Posted January 18, 2008 Maģiskais vārds, par kuru jāpalasa MySQL dokumentācija, ir AUTOINCREMENT Link to comment Share on other sites More sharing options...
mixis Posted January 18, 2008 Report Share Posted January 18, 2008 Maģiskais vārds, par kuru jāpalasa MySQL dokumentācija, ir AUTOINCREMENT Nekur jau netika teikts ka tiek izmantots MySQL, varbūt ka maģiskais vārds ir SEQUENCE Link to comment Share on other sites More sharing options...
marcis Posted January 18, 2008 Report Share Posted January 18, 2008 mixis, tika gan teikts "mysql_query();"! Tabulai `war3users` id vai kas tev tur primārā atslēga jāliek auto_increment Link to comment Share on other sites More sharing options...
Danciic625 Posted January 18, 2008 Author Report Share Posted January 18, 2008 Un kā to izdarīt ? Nemāku īsti šitais pirmais skripts ko veidoju ! Link to comment Share on other sites More sharing options...
Ghenis Posted January 18, 2008 Report Share Posted January 18, 2008 ADD PRIMARY KEY (`kolonnas nosaukums`) Link to comment Share on other sites More sharing options...
Danciic625 Posted January 19, 2008 Author Report Share Posted January 19, 2008 Kur viņu jāliek ? Man īsti nesanāk izmet erroru ! Link to comment Share on other sites More sharing options...
Lynx Posted January 19, 2008 Report Share Posted January 19, 2008 Manuprāt, viņam noteikti jau ir primary key, vajag šim laukam tikai pievienot auto increment. mysql_query('ALTER TABLE `war3users` CHANGE `id` INT NOT NULL AUTO_INCREMENT'); Link to comment Share on other sites More sharing options...
Danciic625 Posted January 19, 2008 Author Report Share Posted January 19, 2008 Pilniigi tas pats raadas , kur vareetu buut probleema ? Link to comment Share on other sites More sharing options...
Kristabs Posted January 19, 2008 Report Share Posted January 19, 2008 Tā kolona droši vien nesaucas `id`. Iekopē tā teibla struktūru. Link to comment Share on other sites More sharing options...
Darkangel Posted January 19, 2008 Report Share Posted January 19, 2008 Paskaidro man sikak labak ko sim skriptam vaidzetu darit? Ja doma nika registraciju tad varu pateikt to ka war3 pats registre nikus automatiski un ievieto mysql datubaze. Link to comment Share on other sites More sharing options...
Recommended Posts