Use get_result()
instead of store_result()
, and then use the result object’s num_rows
:
$a->execute();
$res = $a->get_result();
if ($res->num_rows > 0) {
while ($row = $res->fetch_assoc()) {
$results[] = $row;
}
return $results;
} else {
return false;
}
More Related Contents:
- Use an array in a mysqli prepared statement: `WHERE .. IN(..)` query [duplicate]
- Call to a member function bind_param() on a non-object [duplicate]
- mysqli_stmt::bind_result(): Number of bind variables doesn’t match number of fields in prepared statement
- How to use mysqli prepared statements?
- MySQLi prepared statements error reporting [duplicate]
- Example of how to use bind_result vs get_result
- How to bind mysqli bind_param arguments dynamically in PHP?
- Call to a member function prepare() on a non-object PHP Help
- mysqli: can it prepare multiple queries in one statement?
- Build SELECT query with dynamic number of LIKE conditions as a mysqli prepared statement
- mysqli_stmt::bind_param(): Number of elements in type definition string doesn’t match number of bind variables
- PHP UPDATE prepared statement
- using nulls in a mysqli prepared statement
- mySQLi prepared statement unable to get_result()
- MySQLi prepared statements with IN operator [duplicate]
- Is mysql_real_escape_string() necessary when using prepared statements?
- Using fetch_assoc on prepared statements
- Using wildcards in prepared statement – MySQLi
- bind_param Number of variables doesn’t match number of parameters in prepared statement
- How to prepare statement for update query? [duplicate]
- Using wildcards in prepared statement
- Mysqli Prepare Statement – Returning False, but Why? [duplicate]
- How to run the bind_param() statement in PHP?
- Is using prepared statements necessary? [duplicate]
- Using Prepared Statement, how I return the id of the inserted row?
- Should I use mysqli_real_escape_string or should I use prepared statements? [duplicate]
- Dynamically bind mysqli_stmt parameters and then bind result
- Check to see if an email is already in the database using prepared statements
- How to change mysql to mysqli?
- SELECT * FROM in MySQLi