Advertisement
Guest User

Untitled

a guest
May 26th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <?php
  2.  
  3. /* Put SQL Details here */
  4.  
  5. $sql_host = "";    /* SQL HOST */
  6. $sql_user = "";    /* SQL USER */
  7. $sql_pass = "";    /* SQL PASS */
  8. $sql_db = "";    /* SQL DB */
  9.  
  10. $chan = $_GET['chan'];
  11. $realchan = "#".$chan;
  12.  
  13. /* Script for Luke */
  14.  
  15. $mysql = mysql_connect($sql_host, $sql_user, $sql_pass);
  16. $db = mysql_select_db($sql_db);
  17.  
  18. $sql = "SELECT topic FROM `chan` WHERE `channel` = '".$realchan."' LIMIT 0 , 30";
  19. $result = mysql_query($sql);
  20.  
  21. if (!$result) {
  22.     print mysql_error();
  23. }
  24.  
  25. while ($row = mysql_fetch_array($result)) {
  26.     echo "Topic: ".$row['topic'];
  27. }
  28.  
  29. /* By Niall Davies ( niall@davies.me ) */
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement