narjis Posted February 17, 2011 Share Posted February 17, 2011 I am accessing my datbase bookorama with the follwoiung code @ $db= new mysqli('localhost','bookorama', 'bookorama123','bookorama'); $query = "select * from books where ". $searchtype." like '%".$searchterm."%'"; $results =$db->query($query); $num_results = $result->num_rows; the last line is being echoed but it does not give the number of rows in it. Please help me. I'm stuck Quote Link to comment https://forums.phpfreaks.com/topic/227968-numbers-of-rows-are-not-returned/ Share on other sites More sharing options...
bh Posted February 17, 2011 Share Posted February 17, 2011 Hi, your variable name is wrong: (you forgot an "s", results) $num_results = $results->num_rows; Quote Link to comment https://forums.phpfreaks.com/topic/227968-numbers-of-rows-are-not-returned/#findComment-1175545 Share on other sites More sharing options...
narjis Posted February 17, 2011 Author Share Posted February 17, 2011 thanx alot man so clumsy of me. Bless ya Quote Link to comment https://forums.phpfreaks.com/topic/227968-numbers-of-rows-are-not-returned/#findComment-1175550 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.