0

Estoy utilizando un plugin para wordpress llamado TABLEMASTER para mostrar tablas en un post o una pagina. En este link http://www.torossoftball.club/hector-heredia/ Podrán ver que tengo un resultado de un select que hice y es el siguiente:

[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"]

introducir la descripción de la imagen aquí

MI INTERÉS ES QUE NO SE MUESTRE LOS CAMPOS QUE ESTÁN DENTRO DEL SELECT PARA PODER ELIMINAR EL SEGUNDO SELECT QUE SE VE EN LA IMAGEN.

ACTUALIZANDO: Este es el código en el plugin para mostrar las columnas

     /*
      * 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']);
    }
1
  • Los comentarios no deben usarse para discusiones extendidas; esta conversación ha sido trasladada a un chat. el 9 ene. 2017 a las 14:24

2 respuestas 2

1

PROBLEMA RESUELTO.

Resulta que dicho plugin tiene un subcodigo que me hace lo que estaba consultado por esta via.

[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"]

GRACIAS A TODOS POR SU AYUDA.

introducir la descripción de la imagen aquí

0

Prueba:

$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"];
}

Y usas las variables $valorAP y $valorH para mostrar los valores como necesites.

7
  • No quiero mostrar nada, solo quiero ocultarlo.... mira el linkhttp://www.torossoftball.club/hector-heredia/ fijate que no quiero que se duplique de nuevo los encabezados... ah y estoy utilizando un plugin para wordpress llamado tablemaster.
    – Granedoy
    el 9 ene. 2017 a las 12:05
  • Necesitamos ver el PHP para ver qué ocurre el 9 ene. 2017 a las 12:10
  • el PHP del plugin?
    – Granedoy
    el 9 ene. 2017 a las 12:15
  • Si, el trozo que imprime el resutlado de la consulta el 9 ene. 2017 a las 12:16
  • Arregle la pregunta inicial, verifica si ahora entiendes de otra manera
    – Granedoy
    el 9 ene. 2017 a las 12:24

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.