Uldeens Posted May 19, 2004 Report Share Posted May 19, 2004 (edited) Man ir SKRIPTS kura uzdevums ierakstiit DB 4 veertiibas. It kaa palaizot insert.php eroru neraada bet caur MASCON Skatos un redzu ka DB arii nekaa nav. Kapec tas vareetu buut? Jaa forma ir te FORMA(izlabotaa versija Itka vajadzetu straadaat jo tiesaam studeeju so jautajumu piem seitLINKS un seit LINKS lai neteiktu ka lameris pats neko nedara:) Jaa vel man bija tads INSERT.PHP variants arii neiet. Jaa taa $_request vietaa meeginaju arii $_post un get.. Edited May 19, 2004 by Uldeens Link to comment Share on other sites More sharing options...
sviesc Posted May 19, 2004 Report Share Posted May 19, 2004 tur vienozīmīgi vajaga $_POST jo tas vis tak nāk no post formas un formā neesi norādijs kā dati šutīsies Tev jagag uztasiīt šādi <form action="insert.php" METHOD="post"> jo scripts nezin kādā veidā viņam tie dati ir jāsūta... tas tā es tik aci uzmetu :blink: Link to comment Share on other sites More sharing options...
Uldeens Posted May 19, 2004 Author Report Share Posted May 19, 2004 Nu bija tur post un Arii formaa it Method post.Vienkaarsi lai nebuutu tik gara pentere tai formai es sito uzrakstiju prieks foruma. Paldies sviesc,ka laboji.Formaa viss ir ok(originaalaa) Link to comment Share on other sites More sharing options...
bubu Posted May 19, 2004 Report Share Posted May 19, 2004 tur kljuudas: 1) mysql_select_db("dbname"); a kas taa par datubaazi dbname? tev jau defineets ir $dbname, taapeec arii vajag rakstiit mysql_select_db($dbname); 2) $result="INSERT * INTO $dbtable VALUES('$name','$email','$text','$ip')"; nepareiza INSERT teikuma sintakse! nevajag tur nekaadu * (skaties taksh manuaalii), un paarbaudi vai tev $dbtable tabulai ir preciizi chetras kolonnas? Link to comment Share on other sites More sharing options...
Uldeens Posted May 19, 2004 Author Report Share Posted May 19, 2004 Paldies Sviesc Paldies BU-Bu veel lielaaks. Viss ciki piki. Beigu straadaajosais kods.... <? $host="Localhost"; $dbname="new"; $dbuser="root"; $dbpass=""; $dbtable="forum"; mysql_connect("$host","$dbuser","$dbpass"); mysql_select_db("$dbname"); $name=$_REQUEST['name']; $email=$_REQUEST['email']; $text=$_REQUEST['text']; $ip = getenv ( "REMOTE_ADDR" ); $result="INSERT INTO forum VALUES('','$name','$email','$text','$ip')"; mysql_query($result); mysql_close(); ?> Link to comment Share on other sites More sharing options...
Recommended Posts