raj957 Posted July 13, 2017 Share Posted July 13, 2017 (edited) <label>Select BluePack Bank</label> <select class="form-control" name="advising_bank"> <option>Select a bank</option> <?php $sqll = "SELECT * FROM bpbank"; $sql_run = mysqli_query($connect,$sqll); if(mysqli_num_rows($sql_run)){ while($row = mysqli_fetch_assoc($sql_run)){ ?> <?php $option ?> = <option value = "<?php echo $row['bank_name'] . $row['address'] . " swiftcode: " . $row['swift_code'] . $row['bin_no']; ?>"><?php echo $row['bank_name'];?></option> <?php echo $option; }; }; ?> </select><br> As you can see i have selected all data from a table called bpbank(column names: bank_name, address, swift_code,bin_no). I am showing those data in a drop down list, where i put all the values in the option values="". Now upon submit i want to carry all these data to another table, name:client bank, having the same columns and column names. How do i do it, since all the values in the option are having the same input name given in the <select class="form-control" name="advising_bank"> which is advising_bank. I would appreciate if someone would look into it.... Edited July 13, 2017 by raj957 Quote Link to comment Share on other sites More sharing options...
requinix Posted July 13, 2017 Share Posted July 13, 2017 Don't. The best thing is not to send the bank information but the bank identifier - an ID or some other unique value in the table. Then in the next page you take the ID and look up the bank details in the database again. Sound repetitive? It is. But it needs to be. Information in a form can be modified by anyone easily, so even if you put a particular name and code and whatever into the form, the user can change all that information to be whatever they want instead. With the ID the user can still modify the value, yes, but it's safe because (a) either the new value doesn't exist in the table and you don't find the bank details or (b) it does exist and it's like the user had just picked a different option. Quote Link to comment Share on other sites More sharing options...
raj957 Posted July 13, 2017 Author Share Posted July 13, 2017 i think you have something there.. i will try it and get back you..thanks for the reply Quote Link to comment 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.