If I take some input from a user in $_POST
and json_encode it
$json = json_encode($_POST);
and put it in the query
$save = mysqli_query($con, "INSERT INTO table (json) VALUES ('$json')");
Is this prone to SQL injection? Does this input needs to be escaped? In my tests, I couldn't run any queries with input like
') SELECT * FROM table; --
but I'm not even remotely good at this.
PS - This is a test for learning. I'm not actually doing this in a project.