0

Can you tell me why this happens "Trying to get property 'num_rows' of non-object " in php?

30th Jun 2020, 3:25 AM
Beast
Beast - avatar
5 Respostas
+ 2
See through it, that the thing from where you refer the property from, is a valid object. Share your code for a review, it helps to analyse the problem with a code at presence. If you didn't know how to share links, then just follow the below guide 👇 https://www.sololearn.com/post/75089/?ref=app
30th Jun 2020, 3:35 AM
Ipang
+ 1
https://code.sololearn.com/w2cpughBHiBL/?ref=app
30th Jun 2020, 3:38 AM
Beast
Beast - avatar
+ 1
Ipang Thanks you!!
1st Jul 2020, 4:58 PM
Beast
Beast - avatar
0
Beast, Check whether the object returned by mysqli_query is a valid object before continuing with other operations (including access to number of rows returned). The examples in w3schools shows us how it is done 👇 https://www.w3schools.com/PHP/func_mysqli_query.asp P.S. Avoid mixing up use of procedural & object oriented for mysqli 👍
30th Jun 2020, 1:17 PM
Ipang