I'm stuck on this problem for a while now and looking for helpful suggestions.
$resultset = $connection->multi_query($sql);
pseudo:
IF $resultset > 0 (--> if the sql query returned at least one result) {
// do something
}
now the problem is with the pseudo part, i have tried to the follows:
if($resultset > 0) // takes no effect
if($resultset->num_rows > 0) // Notice: Trying to get property of non-object
I have to use multi_query so mysqli_query/mysqli_fetch_array is not a solution
thanks for the hints....
Please try:
If you check out the documentation of multi query (here), you will see that the function returns a
boolean
.Source code also taken from php manual.
multi_query()
returns a boolean that indicates whether the first query was successful, it doesn't return amysqli_result
object.You have to call the
store_result()
method to get the first result set.To get subsequent result sets you use
more_results()
andnext_result()
.See the examples in the documentation.