Gacha Posted February 8, 2004 Report Share Posted February 8, 2004 NU vai esmu stūlbs, bet man šis te neiet. Esmu 10 reizes izgājis cauri katrai rindiņai bet neko neredzu. Vaina varētu būt 1 rindiņā. <? if (isset($_POST['send'])){ $tablename1 = "admin"; $user1 = $_POST['logins']; $pass1 = $_POST['parole']; $level1 = $_POST['limenis']; $self = $_SERVER['PHP_SELF']; $link1 = mysql_connect($hostname,$dbuser,$dbpass); mysql_select_db("$dbname"); $ins_str1 = "Insert into $tablename1 set user='$user1', pass='$pass1', level='$level1'"; if (!mysql_query ($ins_str1, $link1)) { echo "Posts neizdevās!</p>"; mysql_close(); }} else { ?> NU varbūt te kāds acīgāks atrodas ps. ja noņem to if nost tad strādā, bet bez if nav jēgas. Link to comment Share on other sites More sharing options...
jb4 Posted February 8, 2004 Report Share Posted February 8, 2004 INSERT pieprasījumos nav tāda operatora SET SET ir iekš UPDATE un REPLACE. piemērs pareizam INSERT: INSERT INTO tabula (lauks1,lauks2) VALUES ('vertiba1','vertiba2'); Link to comment Share on other sites More sharing options...
Gacha Posted February 8, 2004 Author Report Share Posted February 8, 2004 Paldies! Kā vienmēr ar tavu palīdzību viss sanāk :D Link to comment Share on other sites More sharing options...
Kaklz Posted February 8, 2004 Report Share Posted February 8, 2004 Paldies! Kā vienmēr ar tavu palīdzību viss sanāk :D gribētos gan redzēt, kā 'ja noņem to if nost tad strādā' Link to comment Share on other sites More sharing options...
Gacha Posted February 8, 2004 Author Report Share Posted February 8, 2004 Tici vai nē bet man strādā, viņš neko nejautājot iemet DB ierakstus un parada ka posts ir ievietots. Bet no sakuma vajag postot lai ievietotu DB tapeecajag if. Link to comment Share on other sites More sharing options...
jb4 Posted February 8, 2004 Report Share Posted February 8, 2004 Iepriekš nepareizi teicu, ka ar INSERT kverijiem nevar rakstīt SET lauks='vertiba'. Protams, ka var. Vajag vienkārši ievērot vienotu pierakstu - vai nu ar VALUES smuki visu uzskaitiit vai arī ar SET ... Link to comment Share on other sites More sharing options...
Recommended Posts