Guest User

Untitled

a guest
Aug 4th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Making preset class variables available to functions
  2. <?php
  3. Class DBcalls {
  4.  
  5. private static $dbconn = pg_connect("host=localhost port=5432 dbname=dbnamehere user=usernamejere password=1234567");
  6.  
  7. function adbcallfunc($called){
  8.  
  9. $result = pg_prepare($dbconn, "adbcallfunc", 'select somecolumn from table where somecolumn = $1');
  10. $result = pg_execute($dbconn, "adbcallfunc", array($called));
  11. $GetResult = @pg_fetch_array($result);
  12. $key = 'othercolumn';
  13. $wantedresults = $GetResult[$key];
  14. return $totalviews;
  15. }
  16.  
  17. }
  18.  
  19. $query = new DBcalls;
  20. $query = $query->IPViewCount('foo');
  21. echo $query;
Add Comment
Please, Sign In to add comment