How can I prevent SQL injection in PHP? example code

How can I prevent SQL injection in PHP? example code

How can I prevent SQL injection in PHP? example

How can I prevent SQL injection in PHP? example 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
By Manish Salunke In php -

Tags:

php

Sponsors

themeforest
pluralsight
Invest in you. Online courses as low as $11.99