num_rows Always shows Zero value in PHP/MYSQL? -
i totally new php.
i practicing prepared statements. know there few questions related mine.
but nothing helped me.
this php code returns num_rows
equal zero.
but there data in table
if (isset($_post['submit'])) { $my_id = 49; $content = $_post['cont']; $content_date = date('d-m-y'); $check = "select * post user_id = ?"; $stmt = $con->prepare($check); $stmt->bind_param("i",$my_id); $stmt->execute(); $stmt->fetch(); $numberofrows = $stmt->num_rows; $stmt->close(); echo '<h1>'.$numberofrows.'</h1>'; }
use () this... $numberofrows = $stmt->num_rows(); , try.
Comments
Post a Comment