Which docs? 🙂
Numbers are numeric, quotes force a string type, you can't insert strings into numeric fields, some databases will refuse to do this.
Quoting data from forms is usefull for security, because if someone puts an extra query inside the form-data, the entire query gets submitted:
$formdata = "1; DELETE FROM table;";
$query = "SELECT * FROM table WHERE field=".$formdata;
$query would contain:
SELECT * FROM table WHERE field=1; DELETE FROM table;
which would execute both queryes and delete all data from the table.
If the data is quoted, youd get this:
SELECT * FROM table WHERE field="1; DELETE FROM table;"
which would return no results because there are no records where 'field' contains "1; DELETE FROM table;"
However, none of the database functions in PHP can execute more than one query at a time, so including extra queries will simply cause the SQL function to fail with a 'invalid query' error.
And that error could give extra information to hackers, which means you should always do proper error-checking so you can disable the standard error-reporting in your production environment.