Advertisement
Guest User

Untitled

a guest
Jul 8th, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <?php
  2. $server = "localhost";
  3. $database = "csgo";
  4. $username = "root";
  5. $password = "";
  6.  
  7. $mysqlConnection = mysql_connect($server, $username, $password);
  8. if (!$mysqlConnection)
  9. {
  10. die("MySQL error.Please try later.");
  11. }
  12. else
  13. {
  14. //echo "Connected";
  15. mysql_select_db($database, $mysqlConnection);
  16. mysql_query("SET NAMES utf8");
  17. }
  18.  
  19. $colors = ['rgb(41, 95, 153)','rgb(255, 127, 0)','rgb(255, 255, 0)','rgb(127, 0, 127)','rgb(0, 168, 51)','rgb(255, 0, 0)','rgb(183, 201, 221)','rgb(119, 58, 0)','rgb(112, 148, 187)','rgb(187, 95, 0)','rgb(27, 119, 119)','rgb(255, 85, 0)','rgb(255, 255, 170)','rgb(76, 15, 42)','rgb(255, 255, 85)','rgb(102, 7, 85)','rgb(13, 143, 85)','rgb(255, 42, 0)','rgb(170, 226, 17)','rgb(170, 0, 85)','rgb(85, 197, 34)','rgb(212, 0, 42)'];
  20.  
  21. function logsqlerror($error)
  22. {
  23. $errortofile=$error."\n\r\n\r";
  24. $file='logsqlerror.txt';
  25.  
  26. // Write the contents of a file,
  27. // Using the flag FILE_APPEND flag to append content to the file
  28. // Flag LOCK_EX to prevent the recording of the file someone else at this time
  29. file_put_contents($file, $errortofile, FILE_APPEND | LOCK_EX);
  30. }
  31.  
  32. function fetchinfo($rowname,$tablename,$finder,$findervalue) {
  33. if($finder == "1") $result = mysql_query("SELECT $rowname FROM $tablename");
  34. else $result = mysql_query("SELECT $rowname FROM $tablename WHERE `$finder`='$findervalue'");
  35. $row = mysql_fetch_assoc($result);
  36. return $row[$rowname];
  37. }
  38.  
  39. function generateCLST($length = 6) {
  40. $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  41. $charactersLength = strlen($characters);
  42. $randomString = '';
  43. for ($i = 0; $i < $length; $i++) {
  44. $randomString .= $characters[rand(0, $charactersLength - 1)];
  45. }
  46. return $randomString;
  47. }
  48.  
  49. function convertid($id) {
  50. if (strlen($id) === 17) {
  51. $converted = substr($id, 3) - 61197960265728;
  52. } else {
  53. return (string) "wrong input";
  54. }
  55. return (string) $converted;
  56. }
  57.  
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement