KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've been having trouble getting the number of rows to return using mysqli. I just get 0 back every time even though there are definitely some results. if($stmt = $mysqli->prepare("SELECT id, title, visible, parent_id FROM content WHERE parent_id = ? ORDER BY page_order ASC;")){ $stmt->bind_param('s', $data->id); $stmt->execute(); $num_of_rows = $stmt->num_rows; $stmt->bind_result($child_id, $child_title, $child_visible, $child_parent); while($stmt->fetch()){ //code } echo($num_of_rows); $stmt->close(); } Why doesn't it show the correct number?
Tags (comma-separated)
Save Edits
Cancel