Hide select COLUMN in MYSQL

0

I am using a wordpress plugin called TABLEMASTER to show tables in a post or a page. In this link link You can see that I have a result of a select that I made and it is as follows:

  

[tablemaster sql="SELECT AP, T, CA, H, 2H, 3H, HR, CE, BB, P, BR, SF, TB, AVE, OBP, SLG, OPS from stats WHERE id = 11"]

MY INTEREST IS THAT I DO NOT SHOW THE FIELDS THAT ARE INSIDE THE SELECT TO BE ABLE TO ELIMINATE THE SECOND SELECT THAT IS SEEN IN THE IMAGE.

UPDATING: This is the code in the plugin to show the columns

     /*
      * Get the column names from the query results.
      */
    $query_columns =  array();
    $num_query_columns = mysql_num_fields($result);
    for( $i=0;$i<$num_query_columns;$i++) {
        array_push($query_columns, mysql_field_name($result, $i) );
    }
// This is the column names as a result of the query. It could be the names of the columns, or custom names for the columns.  If link labels are used, it needs to contain both the link labels and link targets columns.
// it is recommeded that the columns keyword be used if link labels are link targets are used so that you can control whether the link target column is printed.
 // The column names specified in the columns array must match the column names in the query results.           
    /*
     * Get the list of columns that should be printed. 
     */
    $print_columns = array();
    if ( isset( $this->tables[$table_id]['settings']['columns'] )) {
        $print_columns = explode(',', $this->tables[$table_id]['settings']['columns'] );
    } else {
        $print_columns = $query_columns;
    }

    /*
     * Get the list of columns that should not wrap
     */
    $nowrap_columns = array();
    if ( isset( $this->tables[$table_id]['settings']['nowrap'] )) {
        $nowrap_columns = explode(',', $this->tables[$table_id]['settings']['nowrap'] );
     } 

    /*
     * Get the list of column widths. 
     */
    $column_widths = array();
    if ( isset( $this->tables[$table_id]['settings']['col_widths'] )) {
        $column_widths = explode(',', $this->tables[$table_id]['settings']['col_widths']);
    }
    
asked by Granedoy 09.01.2017 в 12:56
source

2 answers

1

PROBLEM SOLVED.

It turns out that this plugin has a subcode that does what I was consulted in this way.

[tablemaster sql="SELECT AP, T, CA, H, 2H, 3H, HR, CE, BB, P, BR, SF, TB, AVE, OBP, SLG, OPS from stats WHERE id = 11"]

[tablemaster nohead="true" sql="SELECT AP, T, CA, H, 2H, 3H, HR, CE, BB, P, BR, SF, TB, AVE, OBP, SLG, OPS from stats WHERE id = 11 "]

THANK YOU ALL FOR YOUR HELP.

    
answered by 09.01.2017 в 15:51
0

Test:

$ask = "SELECT AP, H FROM stats WHERE id = 11";
$result = mysql_query($ask);
while($data = mysql_fetch_array($result)){
   $valorAP = $data["AP"];
   $valorH = $data["H"];
}

And you use the variables $valorAP and $valorH to show the values as you need.

    
answered by 09.01.2017 в 13:04