Guest User

Untitled

a guest
May 28th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. <?php
  2. $db_host = 'localhost';
  3. $db_name = 'DB';
  4. $db_username = 'NAME';
  5. $db_password = 'PASS';
  6. $db_table_to_show = 'TABLE';
  7. $connect_to_db = mysql_connect($db_host, $db_username, $db_password)
  8. or die("Could not connect: " . mysql_error());
  9. mysql_select_db($db_name, $connect_to_db)
  10. or die("Could not select DB: " . mysql_error());
  11. mysql_set_charset("utf8");
  12. $qr_result = mysql_query("select * from " . $db_table_to_show)
  13. or die(mysql_error());
  14. echo '<table id="table">';
  15. echo '<thead>';
  16. echo '<tr>';
  17. echo '<th class="table-fandom">fandom</th>';
  18. echo '<th>author</th>';
  19. echo '<th class="table-name">name</th>';
  20. echo '<th>size</th>';
  21. echo '<th class="table-status">status</th>';
  22. echo '<th>date</th>';
  23. echo '<th>tags</th>';
  24. echo '</tr>';
  25. echo '</thead>';
  26. echo '<tbody>';
  27.  
  28. while($data = mysql_fetch_array($qr_result)){
  29. echo '<tr>';
  30. echo '<td>' . $data['fandom'] . '</td>';
  31. echo '<td>' . $data['author'] . '</td>';
  32. echo '<td><a href="/goto/' . $data['url'] . '" target="_blank">' . $data['name'] . '</a><div class="menu" style="display: none;"><br> ' . $data['annotation'] . ' </div></td>';
  33. echo '<td>' . $data['size'] . '</td>';
  34. echo '<td>' . $data['status'] . '</td>';
  35. echo '<td>' . $data['date'] . '</td>';
  36. echo '<td>' . $data['tags'] . '</td>';
  37. echo '</tr>';
  38. }
  39.  
  40. echo '</tbody>';
  41. echo '</table>';
  42. mysql_close($connect_to_db);
  43. ?>
  44.  
  45. $qr_result = mysql_query("select * from " . $db_table_to_show)
  46.  
  47. SELECT * FROM [TableName] WHERE `AddedDate` BETWEEN "2012-03-15" AND "2012-03-31";
Add Comment
Please, Sign In to add comment