How to use `foreach()` in ajax call

I see that you found the error in the comments given to you on the post, and that is good. However, it should be pointed out that your code contains both an SQL Injection vulnerability, as well as a Reflected XSS vulnerability. $catId = $_POST[‘key’]; // value from the ajax … $result_fromDB = $wpdb->get_results(“SELECT * … Read more

getting the values of hidden inputs to use them in a php mysql query

Please add method=”post” to form like <form id=”form1″ method=”post”> <?php foreach($results as $key): ?> <?php echo $key->ID.$key->display_name.$key->mg_nobility; ?> <!– Append the id to the end of this –> <input type=”text” id=’edit-value-<?php echo $key->ID ?>’ value=”” /> <!– Use the data attr instead –> <button data-rowid='<?php echo $key->ID ?>’ class=”edit_nov”>Submit</button><br> <?php endforeach ?> <input type=”hidden” name=”del_id” … Read more