Created
April 8, 2014 12:41
-
-
Save heitara/10118182 to your computer and use it in GitHub Desktop.
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 | |
// Connects to your Database | |
mysql_connect("localhost", "user", "password") or die(mysql_error()); | |
mysql_select_db("database") or die(mysql_error()); | |
$data = mysql_query("select * from table order by created_at desc limit 1, 2000;") | |
or die(mysql_error()); | |
$row = mysql_fetch_assoc($data); | |
print '<table><tr>'; | |
foreach($row as $name => $value) { | |
print "<th>$name</th>"; | |
} | |
print '</tr>'; | |
while($row) { | |
print '<tr>'; | |
foreach($row as $value) { | |
print "<td>$value</td>"; | |
} | |
print '</tr>'; | |
$row = mysql_fetch_assoc($data); | |
} | |
print '</table>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment