Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save codeeshop-oc/8f4d096b138bb86050401addb77bc5b1 to your computer and use it in GitHub Desktop.
Save codeeshop-oc/8f4d096b138bb86050401addb77bc5b1 to your computer and use it in GitHub Desktop.
Select multiple tables in adminer.php using javascript
/*
Blog - https://codeeshop.medium.com/how-to-select-multiple-tables-in-adminer-php-using-javascript-dcdb0eb3bf44
Youtube Video - https://youtu.be/yF3WIENZVOY
*/
if ($('#jquerycdn') == null || !$('#jquerycdn').length) {
var s = document.createElement("script");
s.type = "text/javascript";
s.id = "jquerycdn";
s.src = "https://code.jquery.com/jquery-2.2.4.min.js";
$("head").append(s);
s.onload = afterJqueryLoad
}
// Function to execute after jQuery loads
function afterJqueryLoad() {
// Tables
const adminerCheckboxes = [
`ps_address`,
`ps_address_format`,
]
$(document).ready(function() {
for (let i = adminerCheckboxes.length - 1; i >= 0; i--) {
$(`table tbody [value="${adminerCheckboxes[i]}"]`).trigger('click')
$(`table tbody [value="${adminerCheckboxes[i]}"]`).parent().parent().next().trigger('click')
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment