Search Unity

Trying to get property 'num_rows' of non-object in C:\xampp\htdocs\Nemeziz\Login.php on line 24<br /

Discussion in 'Scripting' started by AreisTv, Dec 7, 2019.

  1. AreisTv

    AreisTv

    Joined:
    Aug 15, 2019
    Posts:
    6
    Hey, i'm having problems with my login system using Xampp etc.

    Here is the code,

    https://pastebin.com/mVHad0iv

    i tried using "!empty($result) && $result->num_rows > 0 " as someone suggested and indeed the error does go away, but then no matter what user i use even if its in the database or now it always says username does not exist

    basically im following some guys tutorial:


    And he doesnt seem to have this problem at all yet I do and im pretty new to this whole php thing so i am really stuck.
     
  2. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    983
    Try with a single equals sign.

    You should be testing your queries directly against the DB if you have these kinds of problems, that way you could isolate where the problem lies, with your program or with the query/db.

    Also, try to parameterize that query. It's open to SQL injection attacks.
     
unityunity