Best way to stop SQL Injection in PHP

Posted by Andrew G. Johnson on Stack Overflow See other posts from Stack Overflow or by Andrew G. Johnson
Published on 2008-09-12T23:55:00Z Indexed on 2010/06/14 18:32 UTC
Read the original article Hit count: 261

Filed under:
|
|
|

So specifically in a mysql database. Take the following code and tell me what to do.

// connect to the mysql database

$unsafe_variable = $_POST["user-input"];

mysql_query("INSERT INTO table (column) VALUES ('" . $unsafe_variable . "')");

// disconnect from the mysql database

© Stack Overflow or respective owner

Related posts about php

Related posts about sql