Advertisement
Guest User

Untitled

a guest
Oct 9th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. <?php virtual('/Connections/mainconnection.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6. if (PHP_VERSION < 6) {
  7. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8. }
  9.  
  10. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12. switch ($theType) {
  13. case "text":
  14. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15. break;
  16. case "long":
  17. case "int":
  18. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19. break;
  20. case "double":
  21. $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22. break;
  23. case "date":
  24. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25. break;
  26. case "defined":
  27. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28. break;
  29. }
  30. return $theValue;
  31. }
  32. }
  33.  
  34. mysql_select_db($database_mainconnection, $mainconnection);
  35. $query_mainchanel = "SELECT Userchanel.chanelur, Userchanel.embedded1, Userchanel.embedded2, Userchanel.genre, Userchanel.embeddedgame1, Userchanel.embeddedgame2, Userchanel.description, Userchanel.username FROM Userchanel;";
  36. $mainchanel = mysql_query($query_mainchanel, $mainconnection) or die(mysql_error());
  37. $row_mainchanel = mysql_fetch_assoc($mainchanel);
  38. $totalRows_mainchanel = mysql_num_rows($mainchanel);mysql_select_db($database_mainconnection, $mainconnection);
  39. $query_mainchanel = "SELECT Userchanel.chanelur, Userchanel.embedded1, Userchanel.embedded2, Userchanel.genre, Userchanel.embeddedgame1, Userchanel.embeddedgame2, Userchanel.description, Userchanel.username FROM Userchanel";
  40. $mainchanel = mysql_query($query_mainchanel, $mainconnection) or die(mysql_error());
  41. $row_mainchanel = mysql_fetch_assoc($mainchanel);
  42. $totalRows_mainchanel = mysql_num_rows($mainchanel);
  43. $query_mainchanel = "SELECT chanelur, embedded1, embedded2, genre, embeddedgame1, embeddedgame2, `description`, username FROM userchanel ORDER BY chanelur ASC";
  44. $mainchanel = mysql_query($query_mainchanel, $mainconnection) or die(mysql_error());
  45. $row_mainchanel = mysql_fetch_assoc($mainchanel);
  46. $totalRows_mainchanel = mysql_num_rows($mainchanel);
  47. $query_mainchanel = "SELECT chanelur, embedded1, embedded2, genre, embeddedgame1, embeddedgame2, `description`, username FROM userchanel";
  48. $mainchanel = mysql_query($query_mainchanel, $mainconnection) or die(mysql_error());
  49. $row_mainchanel = mysql_fetch_assoc($mainchanel);
  50. $totalRows_mainchanel = mysql_num_rows($mainchanel);
  51.  
  52. mysql_free_result($mainchanel);
  53. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement