Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <?
  2. class DB {
  3.  
  4. function DB( $sql_config ) {
  5.  
  6. $sql = mysql_connect( $sql_config['host'], $sql_config['username'], $sql_config['password'] );
  7. mysql_select_db( $sql_config['database'] );
  8. return $sql;
  9.  
  10. }
  11.  
  12. static function query( $query ) {
  13.  
  14. $result = mysql_query( $query );
  15.  
  16. if ( !$result ) {
  17.  
  18. die( mysql_error().'<br />query: '.$query );
  19.  
  20. }
  21.  
  22. return $result;
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement