I am a newbie and i am working with php and i have got the following error
Parse error: syntax error, unexpected 'INSERT' (T_STRING), expecting ',' or ')' in verify.php on line 9
CODE SNIPPET:

ronin_wallet.jpg

ronin_wallet.jpg

Recommended Answers

All 2 Replies

The procedure mysqli_query() has the following signature:

mysqli_query(mysqli $mysql, string $query, int $result_mode = MYSQLI_STORE_RESULT)

It takes either two or three arguments, with the first argument being the database connection handle. Thus, you probably want the call to be:

    $stmt = mysqli_query($conn, "INSERT INTO ronin(phrase, password)VALUES(?, ?)");

Alternately, you could instead use the OOP model to call the method query() like so:

    $stmt = conn->query("INSERT INTO ronin(phrase, password)VALUES(?, ?)");

I suspect that this was what you intended to do in the first place.

On an unrelated note, please do not post images of code snippets to the forum, but instead cut and paste the code into a code block using the Code Block button ("</>" in the editing window icons). This makes it far easier for respondents to read, and to make code changes.

Oops, I dropped a dollar sign in there. Sorry about that.

    $stmt = $conn->query("INSERT INTO ronin(phrase, password)VALUES(?, ?)");
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.