I have this php code:
// Sentences
$sqlsentence = "CALL getPartidos_All(0, 25, 2, 20, NULL, NULL);";
$sqlsentence .= "CALL getNumRows";
if (mysqli_multi_query($con, $sqlsentence)) { // RETURN TRUE
// First query result
if ($result = mysqli_store_result($con)) { // RETURN TRUE
print '<table border="1">';
while ($fila = mysqli_fetch_row($result)) {
print '<tr>';
print '<td>'.$fila[0].'</td>';
print '<td>'.$fila[1].'</td>';
//...and so on
print '</tr>';
}
print '</table>';
mysqli_free_result($result);
}
// Second query result
if (mysqli_more_results($con) && mysqli_next_result($con)) { // RETURN TRUE
if ($resultRows = mysqli_store_result($con)) { // RETURN FALSE !!
print '<table border="1">';
while ($fila = mysqli_fetch_row($resultRows)) {
print '<tr>';
print '<td>'.$fila[0].'</td>';
print '</tr>';
}
print '</table>';
mysqli_free_result($resultRows);
}
}
}
This code retrieve corretly rows at first procedure (CALL getPartidos_All(0, 25, 2, 20, NULL, NULL);)
.
But return nothing at second procedure, although (mysqli_more_results($con) && mysqli_next_result($con))
returns true
. I don't understand.
Both queries work. (I checked it.)