viewing paste connect.php | PHP

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
<?php
 
    error_reporting(0); # remove syntax errors (VertrigoServ / XAMP and others)
    
    DEFINE( 'HOST', 'localhost' );  # padrão
    DEFINE( 'USER', 'root' );       # usuário do pma
    DEFINE( 'PASS', 'vertrigo' );   # senha do pma
    DEFINE( 'DATABASE', 'board' );  # nome da database do fórum
    DEFINE( 'BOARD', 'http://127.0.0.1:7070/forum/' );     # link do seu fórum (ex: http://forum.cronus-emulator.com/) sempre com a "/"
    
    class   mysql
    {
        public  function    __construct()
        {
                $this->conn = mysql_connect( HOST, USER, PASS ) or die( mysql_error() );
                $this->selec = mysql_select_db( DATABASE, $this->conn ) or die( mysql_error() );
        }
        
        public  function    build( $query )
        {
            $this->query = $query;
        }
        
        public  function    execute()
        {
            $this->query = mysql_query( $this->query ) or die( mysql_error() );
        }
        
        public  function    numrows()
        {
            return mysql_num_rows( $this->query );
        }
        
        public  function    fetchassoc()
        {
            return mysql_fetch_assoc( $this->query );
        }
    }
 
?>
Viewed 1037 times, submitted by Envolvents.