-2
  if ($result-> num_rows > 0) {                
   while($row = $result->fetch_assoc()) {
     code here..}`

Above is my php code, but always server saying below error.

Trying to get property 'num_rows' of non-object in...

Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

-1

Try This >

$result = $conn->query($sql);
if($result){
  if ($result->num_rows > 0) {                
   while($row = $result->fetch_assoc()) {
     code here..}`
}