What is the best practice for running MySQL queries in PHP? Consider the risk of SQL injection. code example
Example: How can I prevent SQL injection in PHP?
//Connect
$unsafe_variable = $_POST["user-input"];
$safe_variable = mysql_real_escape_string($unsafe_variable);
mysql_query("INSERT INTO table (column) VALUES ('" . $safe_variable . "')");
//Disconnect