PHP Question/No php subforum on FreeCodeCamp?

Hi everyone.

Trying to save users entered data in form into a var, so I can pass it to the data base.
Using: $login = mysqli_real_escape_string($_POST[“login_input”]);

Doing it the same way as my video tutorial, but when I submit I get:
Fatal error:Uncaught ArgumentCountError: mysqli_real_escape_string() expects exactly 2 arguments, 1 given

Also: I can’ find any PHP subforum here on FreeCodeCamp. Is it me or should PHP questions be posted here in General ?

Thank you for your attention

freeCodeCamp teaches the MERN stack.

Since PHP is not part of the core curriculum, it doesn’t have its own subforum.

Posting in #general is the correct place.

1 Like

The error is telling you what the problem is.

Look at the docs for the function.
https://www.php.net/manual/en/mysqli.real-escape-string.php

Not sure what tutorial you are referring to so it’s hard to say much more.

1 Like

yes. it was just a tutorial from 2019, so PHP has changed and now 2nd value, that simply indicates once more the connection var, has been added.

now the data passes to the database
thx

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.