I want to store in a session variable the number of rows that returns a statement, but I don´t know how. I´m trying doing it like this, but it doesn´t work.
$stmt = $con->prepare("SELECT model, type, color FROM item WHERE model LIKE '%$type%'");
$stmt->execute();
$_SESSION['numRows'] = $stmt->num_rows;
echo $_SESSION['numRows'];
$result = $stmt->get_result();
$_SESSION['itemsInfo'] = $result->fetch_all();