Error mysqli_num_rows () expects parameter 1 to be mysqli_result, boolean

0

I have an error with this line of my program, it says that it lacks a parameter

mysqli_num_rows () expects parameter 1 to be mysqli_result, boolean

This is the line that tells me that I have an error

fwrite($arch, "<table:table table:name=\"".$this- 
>nombre_tabla($tabla)."\" table:style-name=\"ta1\"><table:table-column 
table:style-name=\"co1\" table:number-columns- 
repeated=\"".mysqli_num_rows($conexion->query("select * from                                                  
".$tabla))."\" table:default-cell-style-name=\"Default\" />");
    
asked by Francisco Cardenas 02.06.2018 в 00:15
source

1 answer

0

You can try to separate the operations like this:

$resultado = $conexion->query("select * from ".$tabla);
fwrite($arch, "<table:table table:name=\"".$this->nombre_tabla($tabla)."\" 
table:style-name=\"ta1\"><table:table-column table:style-name=\"co1\" 
table:number-columns-repeated=\"".mysqli_num_rows($resultado)."\" 
table:default-cell-style-name=\"Default\" />");
    
answered by 02.06.2018 в 00:35