Guest User

Untitled

a guest
Nov 28th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <?
  2.  
  3. $host = 'localhost';
  4. $db = 'tmp';
  5. $user = '*****';
  6. $pass = '*******';
  7.  
  8.  
  9. class Database
  10. {
  11.  
  12.  
  13. function Connect()
  14. {
  15.  
  16. $connect = mysql_connect($host,$user,$pass);
  17.  
  18. mysql_select_db($db,$connect);
  19.  
  20. }
  21.  
  22.  
  23. function Get_last_shout()
  24. {
  25. $messaggio = "";
  26.  
  27. $sql = mysql_query("SELECT * FROM shoutbox_shouts");
  28. while($row = mysql_fetch_arry($sql)) { $messaggio = $row[s_message]; }
  29.  
  30. return $messaggio;
  31. }
  32.  
  33. function  Get_last_user_shout()
  34. {
  35. $mid;
  36.  
  37. $sql = mysql_query("SELECT * FROM shoutbox_shouts");
  38. while($row = mysql_fetch_arry($sql)) { $mid = $row[s_mid]; }
  39.  
  40. $sql = mysql_query("SELECT * FROM members WHERE member_id='$mid';");
  41. $row = mysql_fetch_array($sql);
  42. return $row[members_display_name];
  43. }
  44.  
  45. }
  46.  
  47.  
  48.  
  49. //-----------------
  50. $db = new Database();
  51.  
  52. $db->Connect();
  53.  
  54. echo "" + $db->Get_last_user_shout() + ":" + $db->Get_last_shout() + "";
  55.  
  56.  
  57. ?>
Add Comment
Please, Sign In to add comment