Trying to get property of non-object

前端 未结 2 1545
执念已碎
执念已碎 2021-01-21 11:39

This script works great. I call it in top of my scripts. But if a user that is NOT banned enters the site they get:

Notice: Trying to get property of non-object          


        
2条回答
  •  情书的邮戳
    2021-01-21 12:13

    If there is no matching row, then $row will be FALSE. You should add if ($row) around everything after mysql_fetch_object.

提交回复
热议问题