|
|
|
| You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'id='10'' at line 1
Вот что мне написало на выполнение вот такого скрипта!
// ловим линк :)
$link = $_GET['id'];
if(!preg_match("|^[\d]+$|",$link))
{
header("Location: http://localhost");
exit();
}
// подключаем БД
Connect();
$query = "SELECT COUNT(ID) FROM states WEHRE id='$link'";
$cnt = mysql_query($query);
if(!$cnt) exit(mysql_error());
// Если нет ни одной строки с таким ID
if(mysql_result($cnt,0) == 0)
{
// Редирект на главную страницу
header("Location: http://localhost");
}
|
Почему??? | |
|
|