I have attempted to make a login script accessing a table on a MySQL database. It is getting the error above. Here is the script:

[upl-image-preview url=https://board.phpbuilder.com/assets/files/2018-12-14/1544814270-279978-screenshot-13.jpeg]

    It's bad form to post a screenshot of your IDE. You should instead paste the code in here and use the code formatting markup.

    Your problem is that you fail to check for errors when you connect to the db in line 11. $con->query is not returning an object. According to the docs on mysqli::query, it returns FALSE on failure. You should check the examples in the documentation about how to check for errors when connecting to and querying a database.

      Yeah, if you checked your errors you'd be told your statement has a syntax error. Even the syntax highlighting in the screenshot is pointing it out.

      See also SQL Injection and password hashing

        FRMO? Is that a new radio station in Fredericktown, Missouri?

          Write a Reply...