Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db_host = 'localhost';
- $db_name = 'DB';
- $db_username = 'NAME';
- $db_password = 'PASS';
- $db_table_to_show = 'TABLE';
- $connect_to_db = mysql_connect($db_host, $db_username, $db_password)
- or die("Could not connect: " . mysql_error());
- mysql_select_db($db_name, $connect_to_db)
- or die("Could not select DB: " . mysql_error());
- mysql_set_charset("utf8");
- $qr_result = mysql_query("select * from " . $db_table_to_show)
- or die(mysql_error());
- echo '<table id="table">';
- echo '<thead>';
- echo '<tr>';
- echo '<th class="table-fandom">fandom</th>';
- echo '<th>author</th>';
- echo '<th class="table-name">name</th>';
- echo '<th>size</th>';
- echo '<th class="table-status">status</th>';
- echo '<th>date</th>';
- echo '<th>tags</th>';
- echo '</tr>';
- echo '</thead>';
- echo '<tbody>';
- while($data = mysql_fetch_array($qr_result)){
- echo '<tr>';
- echo '<td>' . $data['fandom'] . '</td>';
- echo '<td>' . $data['author'] . '</td>';
- echo '<td><a href="/goto/' . $data['url'] . '" target="_blank">' . $data['name'] . '</a><div class="menu" style="display: none;"><br> ' . $data['annotation'] . ' </div></td>';
- echo '<td>' . $data['size'] . '</td>';
- echo '<td>' . $data['status'] . '</td>';
- echo '<td>' . $data['date'] . '</td>';
- echo '<td>' . $data['tags'] . '</td>';
- echo '</tr>';
- }
- echo '</tbody>';
- echo '</table>';
- mysql_close($connect_to_db);
- ?>
- $qr_result = mysql_query("select * from " . $db_table_to_show)
- SELECT * FROM [TableName] WHERE `AddedDate` BETWEEN "2012-03-15" AND "2012-03-31";
Add Comment
Please, Sign In to add comment