Фильтруем POST на наличие sql-inject


<?php
function escape_inj ($text) {
  $text = strtolower($text); // Приравниваем текст параметра к нижнему регистру
  if (
  !strpos($text, "select") && // 
  !strpos($text, "union") && //
  !strpos($text, "select") && //
  !strpos($text, "order") && // Ищем вхождение слов в параметре
  !strpos($text, "where") && // 
  !strpos($text, "char") && //
  !strpos($text, "from") //
  ) {
  return true; // Вхождений нету - возвращаем true
  } else {
  return false; // Вхождения есть - возвращаем false
  }
}
$section = $_GET[section]; // Читаем параметр
if (!escape_inj ($section)) { // Проверяем параметр
  echo "Это SQL-инъекция.";
  exit ();
} else {
  $result = mysql_query ("SELECT * FROM `tbl_name` WHERE `section` = $section ");
  ... // Продолжаем работу
}
?>