If you have problems making work this num_rows, you have to declare ->store_result() first.<?php$mysqli = new mysqli("localhost","root", "", "tables");$query = $mysqli->prepare("SELECT * FROM table1");$query->execute();$query->store_result();$rows = $query->num_rows;echo $rows;// Return 4 for example?>