I've read plenty that you need to check and sanitize form data before inserting into database or using in an sql query and I agree with that. But I couldn't find an answer to this, if I only have a number field in my form:
<input type="number" class="form-control" name="max-persons" required>
Do I need to sanitize this? The user can only enters numbers as far as I know.
$maxPersons = $_POST['max-persons'];
// or
$maxPersons = mysqli_real_escape_string($connect, $_POST['max-persons']);
I'm here concerned about SQL injections here primarily.
Edit: I do not believe this is an exact duplicate of linked question. I'm not asking how to prevent SQL injection. I'm asking SHOULD I take steps to prevent SQL injection in case of number fields.