La verdad estoy empezando en esto de php y no tengo ni idea de por que este error, trato de desplegar los valores de mi base de datos en una tabla y me sale esto Notice: Trying to get property 'num_rows' of non-object in C:\xampp\htdocs\Panel\index.php on line 36 <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> <?php $conn = mysqli_connect("localhost", "root", ""); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT * FROM mensajes"; $result = $conn->query($sql); if ($result-> num_rows > 0) { while($row = $result->fetch_assoc()) { echo "<tr><td>" . $row["id"]. "</td><td>" . $row["nombre"] . "</td><td>" . $row["email"]. "</td></tr>"; } echo "</table>"; } else { echo "0 results"; } $conn->close(); ?> <!-- end snippet --> sult->fetch_assoc()) { echo "<tr><td>" . $row["id"]. "</td><td>" . $row["nombre"] . "</td><td>" . $row["email"]. "</td></tr>"; } echo "</table>"; } else { echo "0 results"; } $conn->close(); ?>