background image

    }
    }
    }
    public function query($sql){
    $this->sql = $sql;
    $result = mysql_query($this->sql, 
$this->conn);
    if(!$result){

    $this->show_error('

SQL

', 

$this->sql);
    }else{
    return $this->result = $result;
    }
    }
    public function show_databases(){
    $this->query("show databases");

    echo '

' . mysql_num_rows

($this->result);
    echo "
    ";
    $i = 1;
    while($row=mysql_fetch_array($this->
result)){
    echo "$i $row[Database]" . "
    ";
    $i++;
    }
    }
    public function show_tables(){
    $this->query("show tables");

    echo "

{$this->db_database}

". 

mysql_num_rows($this->result) . "

";

    echo "
    ";
    $column_name = "Tables_in_" . $this->
db_database;
    $i = 1;
    while($row=mysql_fetch_array($this->
result)){
    echo "$i $row[$column_name]" . "
    ";
    $i++;