Danciic625 Posted January 17, 2008 Report 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
bubu Posted January 17, 2008 Report Posted January 17, 2008 Kāds izskatās tabulas war3users CREATE teikums?
mounkuls Posted January 18, 2008 Report 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
Aleksejs Posted January 18, 2008 Report Posted January 18, 2008 Maģiskais vārds, par kuru jāpalasa MySQL dokumentācija, ir AUTOINCREMENT
mixis Posted January 18, 2008 Report 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
marcis Posted January 18, 2008 Report 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
Danciic625 Posted January 18, 2008 Author Report Posted January 18, 2008 Un kā to izdarīt ? Nemāku īsti šitais pirmais skripts ko veidoju !
Danciic625 Posted January 19, 2008 Author Report Posted January 19, 2008 Kur viņu jāliek ? Man īsti nesanāk izmet erroru !
Lynx Posted January 19, 2008 Report 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');
Danciic625 Posted January 19, 2008 Author Report Posted January 19, 2008 Pilniigi tas pats raadas , kur vareetu buut probleema ?
Kristabs Posted January 19, 2008 Report Posted January 19, 2008 Tā kolona droši vien nesaucas `id`. Iekopē tā teibla struktūru.
Darkangel Posted January 19, 2008 Report 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.
Recommended Posts