How can I allow special characters like " ' \ / : ; etc without open up for SQL injection using the code below:
$opendb = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname);
$text = $_POST['text'];
mysql_query("UPDATE table SET text='" . $text . "' WHERE
id='" . $_GET['id'] . "'");
mysql_close($opendb);
$text
contains a sentence from a HTML textarea. When I tries to enter text in a quote it just insert the text before the quotes.