Created
December 14, 2013 22:34
-
-
Save iwek/7965851 to your computer and use it in GitHub Desktop.
wp query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//http://codex.wordpress.org/Class_Reference/wpdb | |
global $wpdb; | |
echo "<h2>Plugin Admin Page</h2>"; | |
$arr = $wpdb->get_results("SELECT * FROM $wpdb->users"); | |
echo '<div id="dt_example"><div id="container"><form><div id="demo">'; | |
echo '<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"><thead><tr>'; | |
foreach ($arr[0] as $k => $v) { | |
echo "<td>".$k."</td>"; | |
} | |
echo '</tr></thead><tbody>'; | |
foreach($arr as $i=>$j){ | |
echo "<tr>"; | |
foreach ($arr[$i] as $k => $v) { | |
echo "<td>".$v."</td>"; | |
} | |
echo "</tr>"; | |
} | |
echo '</tbody></table>'; | |
echo '</div></form></div></div>'; | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
$('#example').dataTable(); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment