Leones Posted June 8, 2011 Share Posted June 8, 2011 Hiya, I'm working on a translation script, but I'm kinda stuck. The basic idea is to generate a form where the to be translated language is not inserted yet, and after adding a translation, you send the form and it gets updated into the database. The code I currently use to generate the form: <form action="translationupdate.php" method="post"> <?php $con = mysql_connect(""); //Connection info hidden, ofc if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("westgadgets", $con); $result = mysql_query("SELECT * FROM translations WHERE nl=''"); // Select empty language stuff, nl in this case while($row = mysql_fetch_array($result)) { echo $row['info']; echo "<input style='display:none;' type='tekst' name ='id' value='" . $row['id'] . "'/>"; // The id is unique, which will be used to update the strings. echo "<input type='tekst' name ='en' value='" . $row['en'] . "'/>"; echo "<input type='tekst' name ='nl' value='" . $row['nl'] . "'/>"; echo "<br />"; } ?> <input type="submit" /> </form> After clicking on the send button, you will be directed to the translationupdate.php page, where the database should be updated, though I have no idea about how to do that with this many variable things. My first question would be, is this the correct method of doing this, or should I be using another method to generate the form and submitting it? The second one would be how to insert the stuff on the next page, doesn't have to be code as I can code it myself if I just know what to do. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/238775-mass-update-into-db/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.