Topic: search string process so it's safe to use with database (php/mysql)
If i've got something like this:
// a search string from URL
$search_string $_GET['search'];
//
// Some processing of the string here...
//
// a possible query with full text search
$query = "SELECT * FROM table WHERE MATCH (content) AGAINST ('$search_string')";
// another possible query
// $query = "INSERT INTO table (asdf) VALUES ('$search_string')";
mysql_query($query);
How is the best way to proccess that string so it's not posible to do something harmful in the database. Like SQL-injections, or similar...