jeudi 21 avril 2016

PHP SQL Injection is it safe?

I want to know if my code is 100% secure agasint SQL injection, it looks like this:

$table = $_GET['table'];
switch ($table) {
case 'data':
    $sql = "select * from $table";
    break;
case 'anothertable':
    $sql = "select * from $table";
    break; 
}
$con = new mysqli($hostname,$username,$password,$db_name);
$result = $con->query($sql);




Aucun commentaire:

Enregistrer un commentaire