Guest User

Untitled

a guest
Oct 2nd, 2017
81
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function cachedConnection(){
  2. static $mysqli_connection;
  3.  
  4. if(!isset($mysqli_connection)){
  5. $mysqli_connection=Database::getConnection();
  6. }
  7.  
  8. return $mysqli_connection;
  9. }
  10.  
  11. function sendQuery($str_query){
  12. return cachedConnection()->query($str_query);
  13. }
  14.  
  15. //then I replaced every $con->query() with sendQuery(), and all
  16. //my unnecessary $con=getCon(); were removed (I was adding that line to the top of every function)
RAW Paste Data