ruu Posted December 15, 2005 Report Share Posted December 15, 2005 (edited) Formaa ievadiitaas veertiibas, peec Submit nospieshanas, nepiecieshams ievietot DB tabulaa, kaa to izdariit? Kaa tieshi jaanoraada lauku nosaukumi? Ja rakstu shaadi: mysql_query("insert into gramata values($nosaukums, $gads, $autors) ") man raada kljuudu zinjojumu: Undefined variable: nosaukums, tas pats ar gads un autors...varbuut zinat, ko es daru nepareizi? Edited December 16, 2005 by ruu Link to comment Share on other sites More sharing options...
php_Stopp Posted December 15, 2005 Report Share Posted December 15, 2005 http://www.w3schools.com/sql/default.asp Link to comment Share on other sites More sharing options...
ruu Posted December 15, 2005 Author Report Share Posted December 15, 2005 Shajaa adresiitee neko sev noderiigu shim gadiijumam neatradu... Link to comment Share on other sites More sharing options...
php_Stopp Posted December 15, 2005 Report Share Posted December 15, 2005 pieļauju, ka tev nav pirms tam nodefinēti tie mainīgie. attiecīgi vajag pievienot (pirms querya) šādas rindas (ja tev nav): $nosaukums = $_POST['nosaukums']; $gads = $_POST['gads']; $autors = $_POST['autors']; Link to comment Share on other sites More sharing options...
Paulinjsh Posted December 16, 2005 Report Share Posted December 16, 2005 (edited) Es gan vairāk ieteiktu šadu risinājumu: $nosaukums = addslashes( $_POST['nosaukums'] ); $gads = addslashes( $_POST['gads'] ); $autors = addslashes( $_POST['autors'] ); tāpat palasīt par addslashes, mysql_escape_string, mysql_real_escape_string funkcijām. Edited December 16, 2005 by Paulinjsh Link to comment Share on other sites More sharing options...
php_Stopp Posted December 16, 2005 Report Share Posted December 16, 2005 vismaz pēc default uzstādījumiem visiem $_POST datiem automātiski pievienojas slashi.. Link to comment Share on other sites More sharing options...
ruu Posted December 16, 2005 Author Report Share Posted December 16, 2005 Liels Jums paldies...man izdevaas, nu viss straadaa!!! Link to comment Share on other sites More sharing options...
Recommended Posts