PHP user input data security
问题 I am trying to figure out which functions are best to use in different cases when inputting data, as well as outputting data. When I allow a user to input data into MySQL what is the best way to secure the data to prevent SQL injections and or any other type of injections or hacks someone could attempt? When I output the data as regular html from the database what is the best way to do this so scripts and such cannot be run? At the moment I basically only use mysql_real_escape_string();