Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2.     namespace SQL;
  3.    
  4.     $host = "localhost";
  5.     $user = "";
  6.     $pass = "";
  7.     $db = "portal";
  8.    
  9.     class main {
  10.         mysql_connect( $host, $user, $pass ) or die( "SQL Module error: unable to access host!" );
  11.         mysql_select_db( $db ) or die( "SQL Module error: unable to select database!" );
  12.        
  13.         function Query( $query ) {
  14.             if ( $query.strlen > 0 ) {
  15.                 return mysql_query( $query );
  16.             } else {
  17.                 die( "SQL Module error: unable to parse query or query erroneous" );
  18.             }
  19.         }
  20.     }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement