A simple question I hope. In using the OOPs mysqli protocol how do I get the number of rows returned in a select query such as:

$queryStr = ("SELECT * FROM entry where username='$userin' AND password='$passwordin'");

Thanks!
WBR

Recommended Answers

All 2 Replies

this doesn't have error handling, but here is how you do it following your line

$result = $mysqli->query($queryStr);

$row_count = $result->num_rows;

$result->close();

Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.